mirror of
https://github.com/lostisland/faraday.git
synced 2025-08-29 00:03:58 -04:00
enable GET requests with body for Net::HTTP adapter
This commit is contained in:
parent
8f7f6694da
commit
6aecc5de6c
@ -40,7 +40,7 @@ module Faraday
|
||||
http.read_timeout = http.open_timeout = req[:timeout] if req[:timeout]
|
||||
http.open_timeout = req[:open_timeout] if req[:open_timeout]
|
||||
|
||||
if :get != env[:method]
|
||||
if :get != env[:method] or env[:body]
|
||||
http_request = Net::HTTPGenericRequest.new \
|
||||
env[:method].to_s.upcase, # request method
|
||||
!!env[:body], # is there request body
|
||||
@ -55,7 +55,7 @@ module Faraday
|
||||
end
|
||||
|
||||
begin
|
||||
http_response = if :get == env[:method]
|
||||
http_response = if :get == env[:method] and env[:body].nil?
|
||||
# prefer `get` to `request` because the former handles gzip (ruby 1.9)
|
||||
http.get url.request_uri, env[:request_headers]
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user