0

I am trying to debug a request that I am making to a server, but I can't figure out what is wrong with it, as it seems to be just like the request that I am putting through on RESTClient.

I am initializing it like so:

request = Net::HTTP::Post.new(url.to_s)
request.add_field "HeaderKey", "HeaderValue"
request.body = requestBody

and then I am executing it like so:

Net::HTTP.start(url.host, url.port) do |http|
  response = http.request(request)
end

The requestBody is a string that is encoded with Base64.encode64.

Is there a way to output the request to see exactly where it's going and with what contents? I've used Paros for checking my iOS connections and I can also output a description of requests from most platforms I've worked with, but I can't figure it out for Ruby.

RileyE
  • 10,874
  • 13
  • 63
  • 106
  • You can view the request and response details on stdout with the `Net::HTTP` debugger. See this StackOverflow question: http://stackoverflow.com/questions/2128698/how-can-i-print-information-about-a-nethttprequest-for-debug-purposes – Jacob Brown Jul 23 '13 at 21:34
  • Does this answer your question? [How can I print information about a NET:HTTPRequest for debug purposes?](https://stackoverflow.com/questions/2128698/how-can-i-print-information-about-a-nethttprequest-for-debug-purposes) – Javier García May 12 '23 at 12:08

1 Answers1

0

I've found that HTTP Scoop works pretty well for grabbing network traffic (disclaimer - it's not free!)

RileyE
  • 10,874
  • 13
  • 63
  • 106