I have following code:
dump, err := httputil.DumpResponse(response, true)
ioutil.WriteFile(response.Request.Host+".txt", dump, 0644)
I creates following file example.com.txt
:
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Accept-Ranges: bytes
Age: 0
Cache-Control: public
Content-Encoding: gzip
Content-Type: text/xml
Date: Sun, 01 Apr 2018 08:52:39 GMT
Last-Modified: Thu, 01 Mar 2018 13:30:10 GMT
Server: Microsoft-IIS/7.5
Vary: Accept-Encoding
Via: 1.1 varnish
8000
� �`I�����B�⓿�O����?����...
How can I read gzipped content from the file now?