mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-08-10 00:01:27 -04:00
plugin: pass block further, also request: do not convert to string, nonw that we'll have signatures
This commit is contained in:
parent
936a8533a7
commit
7c4ef3b12c
@ -34,11 +34,11 @@ module HTTPX
|
||||
branch(default_options).wrap(&blk)
|
||||
end
|
||||
|
||||
def plugin(*args, **opts)
|
||||
def plugin(*args, **opts, &blk)
|
||||
klass = is_a?(Session) ? self.class : Session
|
||||
klass = Class.new(klass)
|
||||
klass.instance_variable_set(:@default_options, klass.default_options.merge(default_options))
|
||||
klass.plugin(*args, **opts).new
|
||||
klass.plugin(*args, **opts, &blk).new
|
||||
end
|
||||
|
||||
# deprecated
|
||||
|
@ -45,7 +45,7 @@ module HTTPX
|
||||
|
||||
def initialize(verb, uri, options = {})
|
||||
@verb = verb.to_s.downcase.to_sym
|
||||
@uri = URI(uri.to_s)
|
||||
@uri = URI(uri)
|
||||
@options = Options.new(options)
|
||||
|
||||
raise(Error, "unknown method: #{verb}") unless METHODS.include?(@verb)
|
||||
|
Loading…
x
Reference in New Issue
Block a user