TWinHTTP

TWinHTTP

USES SynCrtSock

procedure hget(const url: string; var ResponseCode: Integer; var ResponseHeader, ResponseData: SockString);
var
aURI: TURI;
http: TWinHTTP;
begin
http := nil;
try
aURI.From(url);
http := TWinHTTP.Create(aURI.Server, aURI.Port, aURI.Https);
http.IgnoreSSLCertificateErrors := true;
ResponseCode := http.Request(aURI.Address, 'GET', 0, '', '', '', ResponseHeader, ResponseData);
finally
aURI.Clear;
http.Free;
end;
end;

原文地址:https://www.cnblogs.com/hnxxcxg/p/8047600.html