module HTTPX::Chainable

  1. lib/httpx/chainable.rb

Methods

Public Instance

  1. accept
  2. headers
  3. plugin
  4. request
  5. timeout
  6. with
  7. wrap

Public Instance Aliases

plugins -> plugin

Public Instance methods

accept (type)
[show source]
   # File lib/httpx/chainable.rb
23 def accept(type)
24   headers("accept" => String(type))
25 end
headers (headers)
[show source]
   # File lib/httpx/chainable.rb
19 def headers(headers)
20   branch(default_options.with_headers(headers))
21 end
plugin (*plugins)
[show source]
   # File lib/httpx/chainable.rb
31 def plugin(*plugins)
32   klass = is_a?(Session) ? self.class : Session
33   klass = Class.new(klass)
34   klass.instance_variable_set(:@default_options, klass.default_options.merge(default_options))
35   klass.plugins(plugins).new
36 end
request (verb, uri, **options)
[show source]
   # File lib/httpx/chainable.rb
11 def request(verb, uri, **options)
12   branch(default_options).request(verb, uri, **options)
13 end
timeout (**args)
[show source]
   # File lib/httpx/chainable.rb
15 def timeout(**args)
16   branch(default_options.with_timeout(args))
17 end
with (options, &blk)
[show source]
   # File lib/httpx/chainable.rb
39 def with(options, &blk)
40   branch(default_options.merge(options), &blk)
41 end
wrap (&blk)
[show source]
   # File lib/httpx/chainable.rb
27 def wrap(&blk)
28   branch(default_options).wrap(&blk)
29 end