-
Notifications
You must be signed in to change notification settings - Fork 635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to decompress gzip encoded response properly? #664
Comments
Beast only removes the chunk-encoding. You are responsible for everything else, including gzip. Beast is not a "http request library" its a low-level protocol layering on top of HTTP. I don't know the details of gzip encoding so I'm afraid I won't be of much help. However, if you get it working you should consider publishing it as part of a utilities library that works with Beast. |
I tried to compress the std::string of the uncompressed http response body (from www.example.com) with the boost iostream interface using gzip, the first 10 bytes differ from the gzipped http response body |
Perhaps this is related to the "gzip header?" Does HTTP use the header when using the gzip transfer-coding? These links might help: |
It looks like the www.example.com server only use "Content-Encoding: gzip". |
the answer in your second link is correct, change line 42 of my code from |
Aha!!! Nice!! |
I don't see how that integrates with Beast? |
CURL's code serves as a reference on how to setup the zlib correctly, even through boost::iostreams
|
for beast version 76,
the following code is modified from the http client example, with gzip enabled. but I failed to decompress it either with the boost iostream interface or zlib interface, I also tried to save the response body string into a .gz file and try to decompress it with 7-zip, but get a CRC error.
https://pastebin.com/DiUME7Z1
My question is: is the response body in standard gzip format, when Content-Encoding: gzip, how to decompress it properly? Most http request library does not require manual decompression.
The text was updated successfully, but these errors were encountered: