Skip to content

Instantly share code, notes, and snippets.

@natritmeyer
Last active November 8, 2023 15:47
Show Gist options
  • Star 24 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save natritmeyer/6495044 to your computer and use it in GitHub Desktop.
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
Author

@gmichokostas
Copy link

You saved my day. 👍

@gitbnw
Copy link

gitbnw commented Jun 9, 2016

thanks! 👍

@Deekor
Copy link

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

Deekor commented Jan 8, 2017

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

@hcarreras
Copy link

You made my day :)

@Murphydbuffalo
Copy link

Yayyy thank you kindly :)

@andey
Copy link

andey commented Jun 14, 2018

How to write this to the rails logger ?

@gabrielms
Copy link

Thank you!!

@fongfan999
Copy link

You saved my bacon. Thank you.

@uhrohraggy
Copy link

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

@carlosrdemoura
Copy link

Thanks!

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