Using tcpflow to debug HTTP API libraries
woss.name
woss.name
1. It lowercases headers, such that Cookie: becomes cookie:. Technically, the standard says they are case insensitive.
2. When reading responses, it strictly looks for \r\n line endings. \n will not cut. Standard does say \r\n is the only acceptable ending.
Guess which web server violates both of these rules? The one in arc that powers Hacker News. Figuring out why my proxy worked with every website except HN probably wouldn't have been possible without tcpflow.
http://www.wireshark.org/docs/wsug_html_chunked/ChAdvFollowT...
Charles is also extraordinarily handy. I used it extensively while developing an iPhone app in the simulator, since figuring out what NSURLConnection is doing is hard.
sudo tcpflow -c -n lo0 src or dst post 3000
and it'll pick up the traffic.(Thanks for the tips on alternative ways of monitoring TCP traffic flows, folks!)
- What an OAuth-signed SOAP envelope looks like, when Google (who prefer OAuth and require SOAP for some APIs) don't yet have it documented.
- That Chrome will encode links itself if necessary, but Firefox will not, causing a download on a colleagues app to not work on FF.
- That I'd accidentally seyup up my non-desktop app as a desktop app when registering for access to the Twitter API, resulting in an XML error response that Chrome wasn't showing me.
All over HTTPS. If you don't have an app like this (works on Windows, Mac and Linux) you need it.