Question

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?

Was it helpful?

Solution

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;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top