module HTTPX::Plugins

  1. lib/httpx.rb
  2. lib/httpx/plugins/authentication.rb
  3. lib/httpx/plugins/basic_authentication.rb
  4. lib/httpx/plugins/compression.rb
  5. lib/httpx/plugins/compression/brotli.rb
  6. lib/httpx/plugins/compression/deflate.rb
  7. lib/httpx/plugins/compression/gzip.rb
  8. lib/httpx/plugins/cookies.rb
  9. lib/httpx/plugins/digest_authentication.rb
  10. lib/httpx/plugins/follow_redirects.rb
  11. lib/httpx/plugins/h2c.rb
  12. lib/httpx/plugins/multipart.rb
  13. lib/httpx/plugins/persistent.rb
  14. lib/httpx/plugins/proxy.rb
  15. lib/httpx/plugins/proxy/http.rb
  16. lib/httpx/plugins/proxy/socks4.rb
  17. lib/httpx/plugins/proxy/socks5.rb
  18. lib/httpx/plugins/proxy/ssh.rb
  19. lib/httpx/plugins/push_promise.rb
  20. lib/httpx/plugins/retries.rb
  21. lib/httpx/plugins/stream.rb
  22. show all

All plugins should be stored under this module/namespace. Can register and load plugins.

Methods

Public Class

  1. load_plugin
  2. register_plugin

Public Class methods

load_plugin (name)

Loads a plugin based on a name. If the plugin hasn't been loaded, tries to load it from the load path under “httpx/plugins/” directory.

[show source]
   # File lib/httpx.rb
34 def self.load_plugin(name)
35   h = @plugins
36   unless (plugin = h[name])
37     require "httpx/plugins/#{name}"
38     raise "Plugin #{name} hasn't been registered" unless (plugin = h[name])
39   end
40   plugin
41 end
register_plugin (name, mod)

Registers a plugin (mod) in the central store indexed by name.

[show source]
   # File lib/httpx.rb
45 def self.register_plugin(name, mod)
46   @plugins[name] = mod
47 end