http协议基于socket接口实现

HTTP:REST架构,C/S模式,请求类型:GET、PUT、HEAD、POST。

1、client端发送get包:"GET /pub/WWW/TheProject.html HTTP/1.1\r\nHost: www.w3.org\r\n"

http协议基于socket接口实现GET /hello.htm HTTP/1.1
http协议基于socket接口实现Accept: */*
http协议基于socket接口实现Accept-Language: zh-cn
http协议基于socket接口实现Accept-Encoding: gzip, deflate
http协议基于socket接口实现If-Modified-Since: Wed, 17 Oct 2007 02:15:55 GMT
http协议基于socket接口实现If-None-Match: W/"158-1192587355000"
http协议基于socket接口实现User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
http协议基于socket接口实现Host: 192.168.2.162:8080
http协议基于socket接口实现Connection: Keep-Alive
响应包:
http协议基于socket接口实现HTTP/1.1 200 OK
http协议基于socket接口实现ETag: W/"158-1192590101000"
http协议基于socket接口实现Last-Modified: Wed, 17 Oct 2007 03:01:41 GMT
http协议基于socket接口实现Content-Type: text/html
http协议基于socket接口实现Content-Length: 158
http协议基于socket接口实现Date: Wed, 17 Oct 2007 03:01:59 GMT
http协议基于socket接口实现Server: Apache-Coyote/1.1/
 
 ------<body>-------
2、client端发送post包:
 POST /form/entry HTTP/1.1
    Host: hackr.jp
    Connection: keep-alive
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 16
    
 name=ueno&age=37
 响应包:
 HTTP/1.1 200 OK
 Date: Tue, 10 Jul 2012 06:20:15 GMT(响应首部字段)
 Content-Length: 362
 Content-Type: text/html
 
 <html>
 ...
3、client端发送head包:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

http协议基于socket接口实现

上一篇:实验 2:Mininet 实验——拓扑的命令脚本生成


下一篇:Kubernetes imagePullPolicy拉取策略