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

HTTP Debugging

HTTP Debugging

SmashingConf Oxford talk with Curl, Ngrok and Charles Proxy as the main tools mentioned

Lorna Mitchell

March 17, 2015
Tweet

More Decks by Lorna Mitchell

Other Decks in Technology

Transcript

  1. Debugging HTTP
    Lorna Mitchell, SmashingConf 2015

    View Slide

  2. Why Debugging HTTP?

    View Slide

  3. 6 Stages of Debugging

    View Slide

  4. Denial
    That can't happen.

    View Slide

  5. Frustration
    That doesn't happen on my machine.

    View Slide

  6. Disbelief
    That shouldn't happen.

    View Slide

  7. Testing
    Why does that happen?

    View Slide

  8. Gotcha
    Oh, I see.

    View Slide

  9. Relief
    How did that ever work?

    View Slide

  10. Fault-Finding HTTP
    ... is just like fault-finding elsewhere in a web project
    Seeing the problem is usually harder than fixing it

    View Slide

  11. Developer Tools
    Get to know the tools in your browser.

    View Slide

  12. Developer Tools

    View Slide

  13. Curl
    Curl (or cURL) is command-line multitool for HTTP
    http://curl.haxx.se/

    View Slide

  14. 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] 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

    View Slide

  15. Postman

    View Slide

  16. RESTClient

    View Slide

  17. Paw

    View Slide

  18. Ngrok
    Expose local websites to the wider web
    https://ngrok.com/

    View Slide

  19. Charles Proxy
    Multi-platform Web Debugging Proxy
    http://www.charlesproxy.com/

    View Slide

  20. Debugging SSL
    Charles can perform a man-in-the-middle attack

    View Slide

  21. Debugging SSL
    You need to authorise the "attack"

    View Slide

  22. Make Debugging Your Super Power

    View Slide

  23. Other Excellent Tools
    • Postman (Chrome) http://getpostman.com/
    • RESTClient http://restclient.net/
    • Paw http://luckymarmot.com/paw
    • Fiddler http://www.telerik.com/fiddler

    View Slide

  24. Questions?
    From http://www.oreilly.com
    Contact: http://lornajane.net - @lornajane

    View Slide