Http Post with indy

Indy has TIdMultipartFormDataStream for this purpose: procedure TForm1.SendPostData; var Stream: TStringStream; Params: TIdMultipartFormDataStream; begin Stream := TStringStream.Create(”); try Params := TIdMultipartFormDataStream.Create; try Params.AddFile(‘File1’, ‘C:\test.txt’,’application/octet-stream’); try HTTP.Post(‘http://posttestserver.com/post.php’, Params, Stream); except on E: Exception do ShowMessage(‘Error encountered during POST: ‘ + E.Message); end; ShowMessage(Stream.DataString); finally Params.Free; end; finally Stream.Free; end; end;

Delphi: idHttp+SSL

To use Indy’s OpenSSL class, you need ssleay32.dll and libeay32.dll. That probably should have been apparent from the source of the exception in the Indy code you tried to execute. The libraries are linked to from the Indy page mentioned in the question. If you’re legally allowed to do so, you can distribute them with … Read more

WWW server reports error after POST Request by Internet Direct components in Delphi

I’m very sure that I’m POSTing the right data Since it does not work – obviously you do not (or Delphi does not – that makes no difference for server). You should start usual debugging loop: Observe reference working behaviour. Observe your program behavior Spot the difference Eliminate the difference Check if the program works … Read more