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;

posted @ 2017-12-16 20:43  delphi中间件  阅读(994)  评论(0编辑  收藏  举报