Ararat Synapse http post in delphi lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- Woodyka · 2011-05-02 12:41 Dears! I would like to solve the my problem which is the following: I have an url: http://example.net/x.html - I have to post there a variable=value - and the answer is an jpeg image, depending on the value. I works correctly with wget, but I would like to use the synapse http units, but I tried, and read about it, but I think my knowledge is too little for it. But I can downloaded it the image without post:   HTTP := THTTPSend.Create;   try     HTTP.HTTPMethod('POST', 'http://example.net/x.html');     Memo1.Lines.Assign(HTTP.Headers);     Memo2.Lines.LoadFromStream(HTTP.Document);     http.Document.SaveToFile('c:\file.jpg');   finally     HTTP.Free;   end; It works. Please help me about it, how can I solve it with the mentioned post. ---------------------------------------------------------------------- ik · 2011-05-02 16:08 What exactly does not work ? Do you understand that JPEG is a binary format so you can not display it on TMemo properly ? ---------------------------------------------------------------------- Woodyka · 2011-05-02 16:12 I mean, about how to send (post) a variable (example: sw) and its value (test) to an url, and get the answer jpg into a file. I think about httpposturl function , but I cant use it correctly. ---------------------------------------------------------------------- vvzh · 2011-05-02 18:02 I have not used it myself, but according to documentation you can call it the following way: Code: [Select]var   Response: TMemoryStream; // ... Response := TMemoryStream.Create; try   HttpPostURL('http://example.net/x.html', 'sw=test', Response);   Response.SaveToFile('c:\file.jpg'); finally   Response.Free; end; ---------------------------------------------------------------------- Woodyka · 2011-05-03 13:11 Cool! Thank you very much! So simple solution, but it works as well! Thank you!