Skip to content

Instantly share code, notes, and snippets.

@natritmeyer
Last active May 24, 2024 20:46
Show Gist options
  • Select an option

  • Save natritmeyer/6495044 to your computer and use it in GitHub Desktop.

Select an option

Save natritmeyer/6495044 to your computer and use it in GitHub Desktop.
How to debug HTTParty requests
class MyResource
include HTTParty
debug_output $stdout # <= will spit out all request details to the console
#...
end
@natritmeyer
Copy link
Copy Markdown
Author

@gmichokostas
Copy link
Copy Markdown

You saved my day. 👍

@gitbnw
Copy link
Copy Markdown

gitbnw commented Jun 9, 2016

thanks! 👍

@Deekor
Copy link
Copy Markdown

Deekor commented Jan 8, 2017

Any idea on how to configure this if you are not including HTTParty into your class and just calling the method directly?

Example:

HTTParty.post("myurl")

@Deekor
Copy link
Copy Markdown

Deekor commented Jan 8, 2017

Nevermind I found it: response = HTTParty.post(url, :body => body, :debug_output => $stdout)

@hcarreras
Copy link
Copy Markdown

You made my day :)

@Murphydbuffalo
Copy link
Copy Markdown

Yayyy thank you kindly :)

@andey
Copy link
Copy Markdown

andey commented Jun 14, 2018

How to write this to the rails logger ?

@gabrielms
Copy link
Copy Markdown

Thank you!!

@fongfan999
Copy link
Copy Markdown

You saved my bacon. Thank you.

@uhrohraggy
Copy link
Copy Markdown

This is amazingly still valuable 7 years later, thank you!

@carlosrdemoura
Copy link
Copy Markdown

Thanks!

@fguillen
Copy link
Copy Markdown

HTTParty::Basement.debug_output $stdout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment