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

HTTP and Me

HTTP and Me

An introduction to HTTP and how it drives the modern web. Deck was created for and targeted at a lunch and learn for developers, designers, and non-creatives at Blackstone Media (http://www.blackstonemedia.com/) and StarkNine (http://www.starknine.com/) in Louisville, KY.

Screencast: http://youtu.be/uCkptOF75II

Shane Logsdon

August 11, 2014
Tweet

More Decks by Shane Logsdon

Other Decks in Technology

Transcript

  1. GET / HTTP/1.1 Host: duckduckgo.com Content-Type: text/html Cache-Control: no-cache HTTP/1.1

    200 OK Server: nginx Date: Thu, 24 Jul 2014 04:21:31 GMT Content-Type: text/html; charset=UTF-8 Content-Length: 9991 Connection: keep-alive ETag: "53d05a42-2707" Expires: Thu, 24 Jul 2014 04:21:32 GMT Cache-Control: max-age=1 Strict-Transport-Security: max-age=31536000 Accept-Ranges: bytes <!DOCTYPE html> <html class="no-js" lang="en_US"> <head> <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8;charset=utf-8"> …
  2. GET / HTTP/1.1 Host: duckduckgo.com Content-Type: text/html Cache-Control: no-cache HTTP/1.1

    200 OK Server: nginx Date: Thu, 24 Jul 2014 04:21:31 GMT Content-Type: text/html; charset=UTF-8 Content-Length: 9991 Connection: keep-alive ETag: "53d05a42-2707" Expires: Thu, 24 Jul 2014 04:21:32 GMT Cache-Control: max-age=1 Strict-Transport-Security: max-age=31536000 Accept-Ranges: bytes <!DOCTYPE html> <html class="no-js" lang="en_US"> <head> <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8;charset=utf-8"> …
  3. A Request Method is… the primary source of request semantics;

    it indicates the purpose for which the client has made this request and what is expected by the client as a successful result.
  4. 3 & 5 Make Many GET POST HEAD HTTP/1.0 OPTIONS

    PUT DELETE TRACE CONNECT HTTP/1.1
  5. GET / HTTP/1.1 Host: duckduckgo.com Content-Type: text/html Cache-Control: no-cache HTTP/1.1

    200 OK Server: nginx Date: Thu, 24 Jul 2014 04:21:31 GMT Content-Type: text/html; charset=UTF-8 Content-Length: 9991 Connection: keep-alive ETag: "53d05a42-2707" Expires: Thu, 24 Jul 2014 04:21:32 GMT Cache-Control: max-age=1 Strict-Transport-Security: max-age=31536000 Accept-Ranges: bytes <!DOCTYPE html> <html class="no-js" lang="en_US"> <head> <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8;charset=utf-8"> …
  6. Reasons for Headers Provide more information about the request/response context

    Make the request conditional based on the target resource state Suggest preferred formats for the request/ response Supply authentication credentials Modify the expected request processing
  7. GET / HTTP/1.1 Host: duckduckgo.com Content-Type: text/html Cache-Control: no-cache HTTP/1.1

    200 OK Server: nginx Date: Thu, 24 Jul 2014 04:21:31 GMT Content-Type: text/html; charset=UTF-8 Content-Length: 9991 Connection: keep-alive ETag: "53d05a42-2707" Expires: Thu, 24 Jul 2014 04:21:32 GMT Cache-Control: max-age=1 Strict-Transport-Security: max-age=31536000 Accept-Ranges: bytes <!DOCTYPE html> <html class="no-js" lang="en_US"> <head> <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8;charset=utf-8"> …
  8. GET / HTTP/1.1 Host: duckduckgo.com Content-Type: text/html Cache-Control: no-cache HTTP/1.1

    200 OK Server: nginx Date: Thu, 24 Jul 2014 04:21:31 GMT Content-Type: text/html; charset=UTF-8 Content-Length: 9991 Connection: keep-alive ETag: "53d05a42-2707" Expires: Thu, 24 Jul 2014 04:21:32 GMT Cache-Control: max-age=1 Strict-Transport-Security: max-age=31536000 Accept-Ranges: bytes <!DOCTYPE html> <html class="no-js" lang="en_US"> <head> <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8;charset=utf-8"> …
  9. GET / HTTP/1.1 Host: www.duckduckgo.com Content-Type: text/html Cache-Control: no-cache HTTP/1.1

    301 Moved Permanently Server: nginx Date: Thu, 24 Jul 2014 04:30:31 GMT Content-Type: text/html Content-Length: 178 Connection: keep-alive Location: https://duckduckgo.com/ Expires: Thu, 24 Jul 2014 04:30:32 GMT Cache-Control: max-age=1 <html> <head><title>301 Moved Permanently</title></head> <body bgcolor="white"> <center><h1>301 Moved Permanently</h1></center> <hr><center>nginx</center> </body> </html>
  10. Wrapping Up Requests are made to servers. Responses are sent

    in return to clients. Methods note “type” of request Status codes note “type” of response Headers modify request/response All defined in HTTP specifications