Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GetHTTPStr(const http: THTTPSend): string;
- var
- strList: TStringList;
- stream: TMemoryStream;
- begin
- Result := '';
- stream := TMemoryStream.Create;
- strList := TStringList.Create;
- try
- if http.ResultCode = 200 then
- begin
- if pos('gzip', http.Headers.Text) > 0 then
- begin
- GZDecompressStream(HTTP.Document, stream);
- stream.Seek(0, soFromBeginning);
- strList.LoadFromStream(stream);
- result:=strlist.text;
- end
- else
- strList.LoadFromStream(HTTP.Document);
- Result := (strList.Text);
- end
- else
- Result := '';
- finally
- strList.Free;
- stream.Free;
- end;
- http.MimeType :='text/html';
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement