I usually use Fiddler to monitor HTTP request and response, but if it is a Ruby script using Net/HTTP
, all the request and response won't show up in Fiddler.
Is there a way to see all the request and response, and if Fiddler can开发者_如何转开发't do it, can any other tool on Mac or Linux show it?
You want to use the Net::Http::Proxy library in your Ruby script.
Where you have
Net::Http.start(uri.host, uri.port)
you want
Net::HTTP::Proxy('127.0.0.1', '8888').start(uri.host, uri.port)
. . . assuming Fiddler is running on port 8888, as it does out of the box.
Have you tried WireShark?
And maybe you can get Fiddler to work by using a proxy - sending net/http to 127.0.0.1:8888 for instance.
In this instance, I would use Firefox (Firebug) or Chrome (built in developer tools) to do this
(update: a working answer in the comment)
精彩评论