Module: HTTPX::Plugins::Compression
- Defined in:
- lib/httpx/plugins/compression.rb,
lib/httpx/plugins/compression/gzip.rb,
lib/httpx/plugins/compression/brotli.rb,
lib/httpx/plugins/compression/deflate.rb
Overview
This plugin adds compression support. Namely it:
-
Compresses the request body when passed a supported “Content-Encoding” mime-type;
-
Decompresses the response body from a supported “Content-Encoding” mime-type;
It supports both gzip and deflate.
Defined Under Namespace
Modules: Brotli, Deflate, GZIP, OptionsMethods, RequestBodyMethods, RequestMethods, ResponseBodyMethods Classes: Encoder
Class Method Summary collapse
Class Method Details
.configure(klass) ⇒ Object
17 18 19 20 |
# File 'lib/httpx/plugins/compression.rb', line 17 def configure(klass) klass.plugin(:"compression/gzip") klass.plugin(:"compression/deflate") end |
.extra_options(options) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/httpx/plugins/compression.rb', line 22 def () encodings = Module.new do extend Registry end .merge(encodings: encodings) end |