Skip to content

Instantly share code, notes, and snippets.

@JoshCheek
Created August 17, 2015 22:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoshCheek/a54b40790a99ebf8c297 to your computer and use it in GitHub Desktop.
Save JoshCheek/a54b40790a99ebf8c297 to your computer and use it in GitHub Desktop.
Resources for understanding HTTP
Put this together as just some links to various materials I made.
Mostly b/c I'm low on time, but also b/c I Figured it will be good
for you to aggregate it into something coherent :)
----------------
Tools:
Make a request and see both the request and response:
$ curl -v 'http://somewhere.com'
Make a POST request like this:
$ curl -v localhost:3000 -d key=value -d another-data-key=another-value
Start a netcat server on localhost:3000
It prints the request and lets you type in the response (netcat)
Example: https://github.com/JoshCheek/playgrounds/blob/master/nc-http-response.gif
$ nc -l 3000
Within the browser
In Chrome, you can open the Network tab in the dev tools
Then you can see the request / response / cookies from within Chrome
https://gist.github.com/JoshCheek/7f8c5afb8850c5cb8f22
I think this is the one we went over at Teresas's
Exercise ideas (ie redirect the browser, set a cookie, etc)
Shows how to get the ip from the name by pinging the server
Shows how to get a pry inbetween Rack and the app, then you can see the parsed request, and edit the response
https://gist.github.com/JoshCheek/298f542a576bfe960d1e
Tutorial style walkthrough I made for someone (I think Nathan)
Shows how to use netcat and curl and make a rack app, including a 35 line ultra-mini Sinatra-style web framework
https://gist.github.com/JoshCheek/298f542a576bfe960d1e
https://gist.github.com/JoshCheek/142cb8f4cddddf65ce2d
An overview of the approach I wanted to take to introduce this stuff
(ie big picture stuff, how it all fits together)
https://howdns.works
Web comic explaining how DNS works (how your computer figures out where the server is)
https://github.com/turingschool/lesson_plans/tree/master/electives/building-a-webserver
This was an elective I made, we build a webserver in 70 loc
https://gist.github.com/JoshCheek/121e587101d397cbfbf3
This is a Sinatra I made in 90 loc
https://github.com/JoshCheek/playgrounds
Examples of how to play with pieces in isolation:
ActiveRecord, erb, ActiveSupport, Rails view helpers, validations,
routes / url helpers, query params, form names, HTTP escaping / unescaping,
HTML escaping / unescaping, all the status codes, CSS selectors, A 1-file Rails app,
a lot of the above stuff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment