How to send data from a clientdataset via post in delphi

1

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.

    
asked by anonymous 07.07.2016 / 19:28

1 answer

2

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.

    
07.07.2016 / 22:11