Slide 1

Slide 1 text

HTTP a n d m e

Slide 2

Slide 2 text

HTTP RUNS THE MODERN WEB*

Slide 3

Slide 3 text

WHAT IS HTTP?

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

Tim Berners-Lee & Team

Slide 7

Slide 7 text

…Who Created Original HTTP HTML Associated technology for a web server Text-based web browser

Slide 8

Slide 8 text

ALL ABOUT THE GIVE AND TAKE AKA THE REQUEST LIFE CYCLE

Slide 9

Slide 9 text

Basic HTTP Request Life Cycle

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

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 …

Slide 12

Slide 12 text

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 …

Slide 13

Slide 13 text

METHODS TO MADNESS

Slide 14

Slide 14 text

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.

Slide 15

Slide 15 text

3 & 5 Make Many GET POST HEAD HTTP/1.0 OPTIONS PUT DELETE TRACE CONNECT HTTP/1.1

Slide 16

Slide 16 text

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 …

Slide 17

Slide 17 text

OFF WITH ITS HEADERS

Slide 18

Slide 18 text

Examples Host User-Agent Accept Accept-Encoding Accept-Language Request Server Location Content-Type Expires Cache-Control Response

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

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 …

Slide 21

Slide 21 text

SOCIAL STATUS (CODE)

Slide 22

Slide 22 text

Five Main Groups 1XX Informational 2XX Successful 3XX Redirection 4XX Client Error 5XX Server Error

Slide 23

Slide 23 text

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 …

Slide 24

Slide 24 text

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 301 Moved Permanently

301 Moved Permanently


nginx

Slide 25

Slide 25 text

PUTTING IT ALL TOGETHER

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

GITHUB TWITTER WWW @SLOGSDON @SHANELOGSDON SHANE.LOGSDON.IO THANKS! QUESTIONS? FIND ME AT: