HTTP

2016-11-28  本文已影响0人  crf1028

TCP建立连接(Three-way handshake)

  1. C --> S 握手请求
  2. C <-- S 确认请求
  3. C --> S 数据请求
  4. C <-- S 发送数据

Non-Persistent Connections

HTTP with Persistent Connections

HTTP request message example

GET /hello.htm HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT)
Host: www.tutorialspoint.com
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: Keep-Alive

HTTP server respond message example

HTTP/1.1 200 OK
Date: Mon, 27 Jul 2009 12:28:53 GMT
Server: Apache/2.2.14 (Win32)
Last-Modified: Wed, 22 Jul 2009 19:15:56 GMT
Content-Length: 88
Content-Type: text/html
Connection: Closed
<html> <body> <h1>Hello, World!</h1> </body></html>
上一篇下一篇

猜你喜欢

热点阅读