Search code examples
ruby-on-railshttpnet-http

How to inspect HTTP requests made by my Rails app


I want to see what I'm actually POSTing when executing a Net::HTTP::Post from my Rails app, headers and all. How can I inspect the actual request the app is making?


Solution

  • If you want to see that at your view then you can do:

     <%= request.env.inspect %>
    

    If you want to do that using logger at controller:

    def show
        logger.info request.env
      end