There was an error while loading. Please reload this page.
The HTTP.use(:auto_deflate) option can be used for automatically compressing the request body before writing it to the socket:
HTTP.use(:auto_deflate)
response = HTTP.use(:auto_deflate) .post("http://example.org/upload", body: body)
By default gzip encoding will be used, but deflate is also supported:
gzip
deflate
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:
HTTP.use(:auto_inflate)
response = HTTP.use(:auto_inflate).headers("Accept-Encoding" => "gzip") .get("http://example.org/large-file")