I'm developing an application that I need to send data from a ClientDataSet (Delphi) to a web system via Post. How should I proceed? Thankful.
I'm developing an application that I need to send data from a ClientDataSet (Delphi) to a web system via Post. How should I proceed? Thankful.
Try this:
procedure TForm1.Button1Click(Sender: TObject);
var
MyIdHTTP: TIdHTTP;
oStringList: TStringList;
sResponse: String;
begin
oStringList := TStringList.Create;
oStringList.Add('usuario=victor');
oStringList.Add('senha=12345');
MyIdHTTP := TIdHTTP.Create(nil);
try
sResponse := MyIdHTTP.Post('http://SeuEndereco...', oStringList);
finally
MyIdHTTP.Free;
oStringList.Free;
end;
end;
PS: If it is https, just create a TIdSSLIOHandlerSocketOpenSSL
and assign it to the property IOHandler
of MyIdHTTP
, and also make available the dlls libeay32
and ssleay32
, together with the executable.