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)
|
||||
if params.is_a?(String)
|
||||
Base.new(params)
|
||||
elsif params.respond_to?(:read)
|
||||
Streamed.new(params)
|
||||
elsif params
|
||||
elsif params and params.is_a?(Hash)
|
||||
if params.delete(:multipart) == true || has_file?(params)
|
||||
Multipart.new(params)
|
||||
else
|
||||
UrlEncoded.new(params)
|
||||
end
|
||||
elsif params.respond_to?(:read)
|
||||
Streamed.new(params)
|
||||
else
|
||||
nil
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue