I see some discussions on the mailing list, and when I search http://golang.org/src/pkg/net/http/transport.go for "gzip" I see a lot of code, but... I cannot put it all together. net/http is so abstract, especially because much code is both for client and server!
- Does HTTP client and server support transparent gzip and gunzip of requests and responses?
- If so, what do I have to do to make it happen? Some of the code makes it look like it just happens automatically in a certain way if headers are set, and some makes it look like it happens if headers are NOT set. My client is Go, my server is Go. Do I have to set headers on client only? Both client and server?
Thanks,Boris
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
On Sat, Mar 2, 2013 at 6:28 PM, Boris Solovyov <boris.s...@gmail.com> wrote:
I see some discussions on the mailing list, and when I search http://golang.org/src/pkg/net/http/transport.go for "gzip" I see a lot of code, but... I cannot put it all together. net/http is so abstract, especially because much code is both for client and server!
- Does HTTP client and server support transparent gzip and gunzip of requests and responses?
No and yes. As of the last time I looked at this stuff: Go will not gzip request bodies for you, but it will add 'accept-encoding: gzip' to outgoing requests that do not have it already and transparently gunzip them. If it is explicitly set, it will not be transparently gunzip'd, you have to do that yourself.
--