HTTP registration on rails?

Does anyone know of a / gem plugin that will log any HTTP requests that your rail application can create when responding to a request? For example, if you use HTTParty to access the API, how can you see which outgoing requests come from your rails application?

+5
source share
5 answers

You must tell the outgoing HTTP client to use a proxy.

For HTTParty, it's pretty simple (from docs ),

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

If you are looking for a proxy server to configure, I personally like the Paros proxy (Java is so cross-platform and SSL).

+5
source

http_logger gem:

require 'http_logger'

Net::HTTP.logger = Logger.new(...) # defaults to Rails.logger if Rails is defined
Net::HTTP.colorize = true # Default: true

, Net:: HTTP.

https://github.com/railsware/http_logger

+5

, Charles Proxy - .

, , logger.debug().

+1

, , IP http_proxy:

http_proxy '10.2.2.1', 8888

, http://, , SocketError: getaddrinfo: nodename nor servname provided

+1

httplog gem, , , ..

+1

All Articles