Question

I'm trying to isolate a bug that exists either in Python's httplib2 HTTP client or an API. (First guess is the API.) While using httplib2 to POST data to a RESTful API, I'm getting a 401 response status (no authorization) and saving data to the API.

I'd like to examine the HTTP request and response to the client, the very strings put onto and received from the network. The httplib2 code seems too involved to easily capture the values from within it, and might possibly miss the bug.

It seems quicker to look at the network communications with the client. Is there some tool I can use to monitor the client's communications with the local network socket?

Was it helpful?

Solution

I use http://www.charlesproxy.com for all my network debugging.

OTHER TIPS

http://www.wireshark.org/ enables you to monitor local sockets too. I was able to monitor local loopback even on windows using trick whit adding route.

http://wiki.wireshark.org/CaptureSetup/Loopback check Other Alternatives

Or you can just write raw socket server that listen on client side on one port and send data to server on other port and vice versa and prints out all data. It should not take more than dozen of lines of code

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top