Here is a way to do an HTTP post using Indy, in one line, more or less:
Response := FIdHttp.Post(URL, StringStream);
Is there a function out there (function, not library) that allows the equivalent to be done using WinInet?
Preferably, a function that resembles this:
function PostUsingWinInet(const URL, Data :string; SSL :boolean) :string;
I do not want to reinvent the wheel 开发者_运维百科and write my own wrapper function if one already exists.
Thanks!
See this Stack Overflow question: How to send a HTTP POST Request in Delphi using WinInet api.
Take a look at Synapse. Yes it is a library, but not a component one. It exposes classes and simple blocking functions that take the pain out of TCP/IP communication.
For instance, a small program which performs a post (ssl is supported btw):
uses
httpsend;
var
url : string;
urldata : string;
PostData : tMemoryStream;
begin
:
if HttpPostURL(URL, URLData, PostData) then
Writeln('Sent');
end.
精彩评论