HTTP请求信息和响应的格式
请求:
1、请求行(包含请求方法,请求路径,所用的协议)
2、请求头信息
3、请求主题信息
请求的方法:GET POST PUT DELETE TRACE OPTIONS
请求的示例(可以使用Telnet工具模拟get和post请求):
GET /css_learning/test.html HTTP/1.1
Host:localhost
POST /post_test/ HTTP/1.1
Host: localhost
Content-type: application/x-www-form-urlencoded
Content-length:14
name=bowenyang
返回的结果
HTTP/1.1 200 OK
Date: Thu, 21 Oct 2021 06:05:58 GMT
Server: WSGIServer/0.2 CPython/3.6.4
Content-Type: text/html; charset=utf-8
X-Frame-Options: DENY
Content-Length: 14
X-Content-Type-Options: nosniff
Referrer-Policy: same-origin
this is a test