mirror of
https://github.com/rest-client/rest-client.git
synced 2022-11-09 13:49:40 -05:00
explicit check for Hash during payload generation. At least one library (hashery) defines :read on Hash
Signed-off-by: Dmitri Dolguikh <dmitri@appliedlogic.ca>
This commit is contained in:
parent
616067e9bf
commit
352d0a8488
1 changed files with 3 additions and 3 deletions
|
@ -9,14 +9,14 @@ module RestClient
|
||||||
def generate(params)
|
def generate(params)
|
||||||
if params.is_a?(String)
|
if params.is_a?(String)
|
||||||
Base.new(params)
|
Base.new(params)
|
||||||
elsif params.respond_to?(:read)
|
elsif params and params.is_a?(Hash)
|
||||||
Streamed.new(params)
|
|
||||||
elsif params
|
|
||||||
if params.delete(:multipart) == true || has_file?(params)
|
if params.delete(:multipart) == true || has_file?(params)
|
||||||
Multipart.new(params)
|
Multipart.new(params)
|
||||||
else
|
else
|
||||||
UrlEncoded.new(params)
|
UrlEncoded.new(params)
|
||||||
end
|
end
|
||||||
|
elsif params.respond_to?(:read)
|
||||||
|
Streamed.new(params)
|
||||||
else
|
else
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue