Module: HTTPX::Plugins::Cookies::OptionsMethods
- Defined in:
- lib/httpx/plugins/cookies.rb
Overview
adds support for the following options:
- :cookies
-
cookie jar for the session (can be a Hash, an Array, an instance of HTTPX::Plugins::Cookies::CookieJar)
Instance Method Summary collapse
Instance Method Details
#option_cookies(value) ⇒ Object
85 86 87 88 89 90 91 |
# File 'lib/httpx/plugins/cookies.rb', line 85 def (value) jar = value.is_a?(Jar) ? value : Jar.new(value) (@headers.delete("cookie"), jar) if defined?(@headers) && @headers.key?("cookie") jar end |
#option_headers ⇒ Object
77 78 79 80 81 82 83 |
# File 'lib/httpx/plugins/cookies.rb', line 77 def option_headers(*) value = super (value.delete("cookie"), @cookies) if defined?(@cookies) && value.key?("cookie") value end |