Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Debugging HTTP

Debugging HTTP

My favourite tools for debugging issues with HTTP especially in an SOA-ish stack. Featured tools: curl, wireshark and Charles

Lorna Mitchell

July 16, 2014
Tweet

More Decks by Lorna Mitchell

Other Decks in Technology

Transcript

  1. Fault-Finding HTTP ... is just like fault-finding elsewhere in a

    web project Seeing the problem is usually harder than fixing it
  2. Lornajane's Curl Cheat Sheet -X [verb] The verb to use

    for this request -H "[Header: value]" A header to send. Use as many times as needed -d [value] Either the whole body data as a string, a filename, or a key/value pair -s The "silent" switch, to hide curl's progress meter when piping the output to something else -c [filename] Where to store any incoming cookies for future use -b [filename] Cookies to send with the request -v to show headers for both request and response
  3. Python's JSON Library A python tool, handily available via CLI

    [some json] | python -mjson.tool http://docs.python.org/2/library/json.html
  4. Wireshark Copies traffic from your network card to allow you

    to view it • Quick way to observe without adding debug to your application • Can use tcpdump to capture on a server, wireshark to inspect later • Or tunnel the data over SSH • Save and load sessions https://www.wireshark.org/
  5. Charles Proxy Multi-platform Web Debugging Proxy http://www.charlesproxy.com/ • Observe requests

    • Firefox plugin • Change requests • Use Charles as a network proxy • Repeat/save requests (detailed article: http://lrnja.net/ZuiDYJ)
  6. Other Excellent Tools • httpie https://github.com/jkbr/httpie • Fiddler http://www.telerik.com/fiddler •

    Postman (Chrome) http://getpostman.com/ • RESTClient (Firefox) http://restclient.net/ • mitmproxy http://mitmproxy.org/ • jq http://stedolan.github.io/jq/ • hurl.it http://www.hurl.it/