--- tags: Web, slide --- # HTTP * Technical overview * History * HTTP session * Request message --- ### What is HTTP protocol * Hypertext Transfer Protocol * An application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. * Foundation of World Wide Web, where hypertext documents are **easily** accessible. ![TCP and HTTP](https://i.imgur.com/u6Hq1PY.png =400x) --- ### History * Initiated by Tim Berners-Lee at CERN in 1989. * HTTP/1 was first documented in 1997 * HTTP/2 is more efficient on expression, publised in 2015, and used by 45% of web site --- ![Tim Berners-Lee](https://i.imgur.com/ZN5SciO.jpg =400x) --- ## Protocol session * TCP (transmission control protocol), typically port 80 * Persistent connection * HTTP/1.1 introduce keep-alive-mechanism. * the connection can be reused; it would not be closed after a single requrest/response pair * reduce request latency because client does not need to re-negotiate the TCP 3-way-hankshake. * **Stateless** protocol * server maintains no information about past client request * some web applications implements states or server side sessions using HTTP cookies or hidden variables --- 3-way handshake: ![3-way handshake](https://i.imgur.com/QYRHKrX.png =300x) --- Persistent connection: ![persistent connection](https://i.imgur.com/f6mGJYP.png =400x) ![](https://i.imgur.com/usY4wfc.png =500x) --- ## Request method * GET: get content information. * HEAD: only metadata, not entire content. * POST * PUT * DELETE * TRACE * OPTIONS * CONNECT See [Here](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods) for more description. --- ### HTTPS * 安全超文字傳輸協議 它是一個安全通訊通道 HTTPS是HTTP over SSL/TLS,HTTP是應用層協議,TCP是傳輸層協議,在應用層和傳輸層之間,增加了一個安全套接層SSL/TLS: * SSL (Secure Socket Layer,安全套接字層) * TLS (Transport Layer Security,傳輸層安全協議) * SSL使用40 位關鍵字作為RC4流加密演算法 ## More study {%youtube d8Ib8a3TeN0 %}(HTTP Overview) --- {%youtube iD2fgC74ZtA %} ---