| Class | FaradayMiddleware::Gzip |
| In: |
lib/faraday_middleware/gzip.rb
|
| Parent: | Faraday::Middleware |
Middleware to automatically decompress response bodies. If the "Accept-Encoding" header wasn‘t set in the request, this sets it to "gzip,deflate" and appropriately handles the compressed response from the server. This resembles what Ruby 1.9+ does internally in Net::HTTP#get.
This middleware is NOT necessary when these adapters are used:
| BROTLI_SUPPORTED | = | optional_dependency 'brotli' |
| ACCEPT_ENCODING | = | 'Accept-Encoding'.freeze |
| CONTENT_ENCODING | = | 'Content-Encoding'.freeze |
| CONTENT_LENGTH | = | 'Content-Length'.freeze |
| SUPPORTED_ENCODINGS | = | supported_encodings.join(',').freeze |
| RUBY_ENCODING | = | '1.9'.respond_to?(:force_encoding) |