Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Introduction to HTTP

History, Knowledge and Usages of HTTP

  • Login to see the comments

  • Be the first to like this

Introduction to HTTP

  1. 1. Introduction to HTTP History, Knowledge and Usages code4crafter@gmail.com 2015.4.1
  2. 2. O U T L I N E • History • HTTP Basics • Extended Topics
  3. 3. Background - Beyond text • Hypertext is text which is not constrained to be linear. Hypertext is text which contains links to other texts. ——《Computer Lib/Dream Machines》 Ted Nelson
  4. 4. W h a t i s “ h y p e r ” ?
  5. 5. P r o j e c t X a n a d u ( 1 9 6 0 - 2 0 1 4 ? )
  6. 6. The Birth of Web 1989 • Tim Beners-Lee @CERN
  7. 7. T h e F i r s t B r o w s e r • “WorldWideWeb”(Nexus)
  8. 8. The First Web Server • CERN httpd on NeXT
  9. 9. The First Website • http://info.cern.ch/hypertext/WWW/TheProject.html
  10. 10. WWW and Internet
  11. 11. O U T L I N E • History • HTTP Basics • Extended Topics
  12. 12. HTTP Message Structure
  13. 13. HTTP Message Structure — Start Line • Method • OPTIONS/GET/HEAD/POST/PUT/DELETE/TRACE/CONNECT • http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html • URL • URL is an impl of URI • Status Code(Response) • 1xx/2xx/3xx/4xx/5xx • http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html • Reason-Phrase(Response) • 200 OK, 404 Not Found, • CRLF • Carriage-Return r Line-Feed n
  14. 14. HTTP Message Structure — Headers • Request Headers • Accept headers: • Accept, Accept-Charset, Accept-Encoding , Accept-Language • Conditional request headers: • If-Match, If-None-Match, If-Modified-Since, If-Unmodified-Since • Request security headers: • Authorization, Cookie, Cookie2 • Proxy request headers: • Max-Forwards, Proxy-Authorization, Proxy-Connection
  15. 15. HTTP Message Structure — Headers • Response Headers • Negotiation headers: • Accept-Ranges, Vary • Response security headers: • Proxy-Authenticate, Set-Cookie, Set-Cookie2, WWW-Authenticate, Access-Control-Allow-Origin • Content cache headers: • ETag, Last-Modified, Expires, Cache-Control
  16. 16. HTTP Message Structure — Body • Content Headers • Content-Type • Content-Type: application/x-www-form-urlencoded • Content-Type: text/html; charset=utf-8 • Content-Length • Content-Encoding • Content-Range • Content-Language
  17. 17. O U T L I N E • History • HTTP Basics • Extended Topics
  18. 18. Persistent Connection • Why Keep-Alive • The TCP connection setup handshake • TCP slow-start congestion control • Nagle’s Algorithm and TCP_NODELAY • HTTP 1.0 • Connection: Keep-Alive • HTTP 1.1 • By Default Keep Alive • To Close: Connection: Close
  19. 19. Caching • Browser Caching • Document Expires? • Cache-Control: max-age=604800 • Expire: Tue, 07 Apr 2015 15:26:18 GMT
  20. 20. Caching — Revalidation with Server • Date • Tag
  21. 21. Content-Type — Internet media type • image/audio/video/text/application/multipart • http://en.wikipedia.org/wiki/Internet_media_type • Application • application/x-www-form-urlencoded • Query String => Post Body • application/xml, application/json
  22. 22. Content-Type — Multipart & MIME • Multipart • multipart/form-data • MIME—Multi-Purpose Internet Mail Extensions
  23. 23. Range • Response • Content-Length/ Accept-Ranges • Request • Range
  24. 24. H t t p v e r s i o n s • HTTP V 0.9(1991) • Request-Response, only GET • HTTP V 1.0(1992 draft,1996 release) • Version Code, More Operations, Headers, Mime • HTTP V 1.1(1992 draft,1999 release) • Keep-alive, Proxy • HTTP V 2.0(2014 draft,? release) • Header Compression, Parallel Loading over single connection
  25. 25. E n d • Thanks!

×