module HTTPX::Plugins::Compression

  1. lib/httpx/plugins/compression.rb
  2. lib/httpx/plugins/compression/brotli.rb
  3. lib/httpx/plugins/compression/deflate.rb
  4. lib/httpx/plugins/compression/gzip.rb
  5. show all

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.

gitlab.com/honeyryderchuck/httpx/wikis/Compression

Methods

Public Class

  1. extra_options
  2. load_dependencies

Public Class methods

extra_options (options)
[show source]
   # File lib/httpx/plugins/compression.rb
22 def self.extra_options(options)
23   options.merge(headers: { "accept-encoding" => Compression.registry.keys })
24 end
load_dependencies (klass)
[show source]
   # File lib/httpx/plugins/compression.rb
17 def self.load_dependencies(klass)
18   klass.plugin(:"compression/gzip")
19   klass.plugin(:"compression/deflate")
20 end