views:

75

answers:

2

Does anyone know of a plugin / gem that will log any HTTP requests your rails app may be making when responding to a request? For example if you are using HTTParty to hit an API, how can you see what outbound requests are coming out of your rails app?

A: 

If you're doing development on your own machine, Charles Proxy is a good option.

In production, you'd probably be better off creating your own logger.debug() messages.

Erik Peterson
I've been using Charles and it doesn't seem to log any of the calls to external apis using HTTParty
bwizzy
+2  A: 

You have to tell the outbound HTTP client to use a proxy.

For HTTParty it's fairly simple (from the docs),

class Twitter
    include HTTParty
    http_proxy 'http://myProxy', 1080

If you're looking for a proxy to set up, personally I like Paros proxy (Java so cross platform and does SSL).

Michiel Kalkman