Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 325
Compression
No GUI edited this page Apr 7, 2018
·
3 revisions
The HTTP.use(:auto_deflate) option can be used for automatically compressing the request body before writing it to the socket:
response=HTTP.use(:auto_deflate).post("http://example.org/upload",body: body)By default gzip encoding will be used, but deflate is also supported:
response=HTTP.use(:auto_deflate=>{:method=>:deflate}).post("http://example.org/upload",body: body)The HTTP.use(:auto_inflate) option can be used for automatically decompressing the response body:
response=HTTP.use(:auto_inflate).headers("Accept-Encoding"=>"gzip").get("http://example.org/large-file")