Module: HTTPX::Plugins::Cookies

Defined in:
lib/httpx/plugins/cookies.rb

Overview

This plugin implements a persistent cookie jar for the duration of a session.

It also adds a #cookies helper, so that you can pre-fill the cookies of a session.

gitlab.com/honeyryderchuck/httpx/wikis/Cookies

Defined Under Namespace

Modules: HeadersMethods, InstanceMethods Classes: Store

Class Method Summary collapse

Class Method Details

.extra_options(options) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/httpx/plugins/cookies.rb', line 17

def self.extra_options(options)
  Class.new(options.class) do
    def_option(:cookies) do |cookies|
      return cookies if cookies.is_a?(Store)

      Store.new(cookies)
    end
  end.new(options)
end

.load_dependenciesObject



64
65
66
# File 'lib/httpx/plugins/cookies.rb', line 64

def self.load_dependencies(*)
  require "http/cookie"
end