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

033132c341296d7f5e5b41e871178418?s=128

Shane Logsdon

August 11, 2014
Tweet

Transcript

  1. HTTP a n d m e

  2. HTTP RUNS THE MODERN WEB*

  3. WHAT IS HTTP?

  4. Hypertext Transfer Protocol an application protocol for distributed, collaborative, hypermedia

    information systems
  5. Hypertext Transfer Protocol an application protocol for distributed, collaborative, hypermedia

    information systems
  6. Tim Berners-Lee & Team

  7. …Who Created Original HTTP HTML Associated technology for a web

    server Text-based web browser
  8. ALL ABOUT THE GIVE AND TAKE AKA THE REQUEST LIFE

    CYCLE
  9. Basic HTTP Request Life Cycle

  10. None
  11. 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"> …
  12. 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"> …
  13. METHODS TO MADNESS

  14. 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.
  15. 3 & 5 Make Many GET POST HEAD HTTP/1.0 OPTIONS

    PUT DELETE TRACE CONNECT HTTP/1.1
  16. 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"> …
  17. OFF WITH ITS HEADERS

  18. Examples Host User-Agent Accept Accept-Encoding Accept-Language Request Server Location Content-Type

    Expires Cache-Control Response
  19. 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
  20. 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"> …
  21. SOCIAL STATUS (CODE)

  22. Five Main Groups 1XX Informational 2XX Successful 3XX Redirection 4XX

    Client Error 5XX Server Error
  23. 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"> …
  24. 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>
  25. PUTTING IT ALL TOGETHER

  26. 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
  27. GITHUB TWITTER WWW @SLOGSDON @SHANELOGSDON SHANE.LOGSDON.IO THANKS! QUESTIONS? FIND ME

    AT: