문제

I have this code in jquery:

var ajaxHandler;
ajaxHandler = "http://mypage.com/_LAYOUTS/com/Handlers/LoginHandler.ashx";
$.post(ajaxHandler + "?task=Login", { UserName: _UserName, Password: _Password },
   function (data) {
     // ...
   }
)

How Can retrieve the 'data' that returned from that page? using indy http or ipworks http?

도움이 되었습니까?

해결책

Using Indy's TIdHTTP component:

var
  Params: TStringList;
  Data: string;
begin
  Params := TStringList.Create;
  try
    Params.Add('UserName=' + UserName);
    Params.Add('Password=' + Password);
    Data := IdHTTP.Post('http://mypage.com/_LAYOUTS/com/Handlers/LoginHandler.ashx?task=Login', Params);
  finally
    Params.Free;
  end;
end;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top