Module: HTTPX::Plugins

Defined in:
lib/httpx.rb,
lib/httpx/plugins/h2c.rb,
lib/httpx/plugins/xml.rb,
lib/httpx/plugins/auth.rb,
lib/httpx/plugins/grpc.rb,
lib/httpx/plugins/oauth.rb,
lib/httpx/plugins/proxy.rb,
lib/httpx/plugins/brotli.rb,
lib/httpx/plugins/expect.rb,
lib/httpx/plugins/stream.rb,
lib/httpx/plugins/webdav.rb,
lib/httpx/adapters/sentry.rb,
lib/httpx/plugins/cookies.rb,
lib/httpx/plugins/retries.rb,
lib/httpx/plugins/upgrade.rb,
lib/httpx/plugins/auth/ntlm.rb,
lib/httpx/plugins/aws_sigv4.rb,
lib/httpx/plugins/callbacks.rb,
lib/httpx/plugins/grpc/call.rb,
lib/httpx/plugins/ntlm_auth.rb,
lib/httpx/plugins/proxy/ssh.rb,
lib/httpx/plugins/auth/basic.rb,
lib/httpx/plugins/basic_auth.rb,
lib/httpx/plugins/persistent.rb,
lib/httpx/plugins/proxy/http.rb,
lib/httpx/plugins/upgrade/h2.rb,
lib/httpx/plugins/auth/digest.rb,
lib/httpx/plugins/auth/socks5.rb,
lib/httpx/plugins/digest_auth.rb,
lib/httpx/plugins/ssrf_filter.rb,
lib/httpx/plugins/grpc/message.rb,
lib/httpx/plugins/proxy/socks4.rb,
lib/httpx/plugins/proxy/socks5.rb,
lib/httpx/plugins/push_promise.rb,
lib/httpx/plugins/rate_limiter.rb,
lib/httpx/plugins/content_digest.rb,
lib/httpx/plugins/response_cache.rb,
lib/httpx/plugins/circuit_breaker.rb,
lib/httpx/plugins/follow_redirects.rb,
lib/httpx/plugins/internal_telemetry.rb,
lib/httpx/plugins/response_cache/store.rb,
lib/httpx/plugins/aws_sdk_authentication.rb,
lib/httpx/plugins/response_cache/file_store.rb

Overview

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

Defined Under Namespace

Modules: AWSSigV4, Auth, Authentication, AwsSdkAuthentication, BasicAuth, Brotli, Callbacks, CircuitBreaker, ContentDigest, Cookies, DigestAuth, Expect, FollowRedirects, GRPC, H2, H2C, InternalTelemetry, NTLMAuth, OAuth, Persistent, Proxy, PushPromise, RateLimiter, ResponseCache, Retries, Sentry, SsrfFilter, Stream, Upgrade, WebDav, XML

Class Method Summary collapse

Class Method Details

.load_plugin(name) ⇒ Object

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.



21
22
23
24
25
26
27
28
29
# File 'lib/httpx.rb', line 21

def self.load_plugin(name)
  h = @plugins
  m = @plugins_mutex
  unless (plugin = m.synchronize { h[name] })
    require "httpx/plugins/#{name}"
    raise "Plugin #{name} hasn't been registered" unless (plugin = m.synchronize { h[name] })
  end
  plugin
end

.register_plugin(name, mod) ⇒ Object

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



33
34
35
36
37
# File 'lib/httpx.rb', line 33

def self.register_plugin(name, mod)
  h = @plugins
  m = @plugins_mutex
  m.synchronize { h[name] = mod }
end