Last active
August 11, 2020 14:25
-
-
Save sorokadima/7ba437f861206d23a91d5c0cd2496f3a to your computer and use it in GitHub Desktop.
Ruby Rails Faraday Request Log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rails s -p 3011 | tee output.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
con = Faraday.new(url: url, params: {}, headers: headers) do |faraday| | |
faraday.response :logger, nil, { headers: true, bodies: true } | |
faraday.adapter Faraday.default_adapter | |
end | |
if method_type == 'post' | |
con.post do |req| | |
req.body = request_body | |
end | |
else | |
con.get | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment