module HTTPX::Plugins::Auth::OptionsMethods

  1. lib/httpx/plugins/auth.rb

adds support for the following options:

:auth_header_value

the token to use as a string, or a callable which returns a string when called.

:auth_header_type

the authentication type to use in the “authorization” header value (i.e. “Bearer”, “Digest”…)

:generate_auth_value_on_retry

callable which returns whether the request should regenerate the auth_header_value when the request is retried (this option will only work if the session also loads the :retries plugin).

Public Instance methods

option_auth_header_type(value)
[show source]
   # File lib/httpx/plugins/auth.rb
31 def option_auth_header_type(value)
32   value
33 end
option_auth_header_value(value)
[show source]
   # File lib/httpx/plugins/auth.rb
27 def option_auth_header_value(value)
28   value
29 end
option_generate_auth_value_on_retry(value)
[show source]
   # File lib/httpx/plugins/auth.rb
35 def option_generate_auth_value_on_retry(value)
36   raise TypeError, "`:generate_auth_value_on_retry` must be a callable" unless value.respond_to?(:call)
37 
38   value
39 end