- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
procedure TForm1.IdHTTPServer1CommandGet(AContext: TIdContext;
ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
var
http:tidhttp;
ss:tstringstream;
begin
try
http:=tidhttp.Create(nil);
http.CookieManager:=tIdcookiemanager.Create(nil);
http.HandleRedirects:=true;
http.AllowCookies:=True;
http.Request.UserAgent:='Mozilla/5.0 (Windows NT 6.1; rv:56.0) Gecko/20100101 Firefox/56.0';
http.IOHandler:=tidssliohandlersocketopenssl.Create(nil);
http.Compressor:=tidcompressorzlib.Create(nil);
http.Request.Accept:='text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
http.Request.AcceptEncoding:='gzip, deflate';
SS:=tstringstream.Create;
HTTP.Get(ARequestInfo.URI, SS);
aresponseinfo.CharSet:=http.Response.CharSet;
aresponseinfo.ContentType:=http.Response.ContentType+'; '+'charset='+http.Response.CharSet+';';
aresponseinfo.ContentStream:=SS;
AResponseInfo.WriteContent;
except
end;
end;