一,請求包括哪些部分 :
請求格式
1?.動詞(?GET POST PUT PATCH DELETE HEAD OPTIONS 等) 路徑 協(xié)議/版本
2 Key1: value1
2 Key2: value2
2 Key3: value3
2 Content-Type: application/x-www-form-urlencoded
2 Host: www.baidu.com
2 User-Agent: curl/7.54.0
3(回車)
4 要上傳的數(shù)據(jù)
如何用Chrome開發(fā)者工具查看 HTTP 請求內(nèi)容
查看 HTTP 請求內(nèi)容:(GET/POST)
例子1
GET / HTTP/1.1
Host: www.baidu.com
User-Agent: curl/7.54.0
Accept: */*
Huang: xxx
使用curl命令:curl -X POST -s -v -H "Huang: xxx" -- "https://www.baidu.com"
例子2
POST / HTTP/1.1
Host: www.baidu.com
User-Agent: curl/7.54.0
Accept: */*
Huang: xxx
使用curl命令:curl -X POST -d "215767230" -s -v -H "Huang: xxx" -- "https://www.baidu.com"
例子3
POST / HTTP/1.1
Host: www.baidu.com
User-Agent: curl/7.54.0
Accept: */*
Huang: xxx
Content-Length: 10
Content-Type: application/x-www-form-urlencoded
回車
215667230
用Chrome開發(fā)者工具查看 HTTP 響應(yīng)內(nèi)容、
二邪狞,響應(yīng)包括哪些部分 :
響應(yīng)格式:
1 協(xié)議/版本號 狀態(tài)碼 狀態(tài)解釋
2 Key1: value1
2 Key2: value2
2 Content-Length: 17931
2 Content-Type: text/html
3(回車)
4 要下載的內(nèi)容
響應(yīng)例子:
HTTP/1.1 302 Found
Connection: Keep-Alive
Content-Length: 17931
Content-Type: text/html
Date: Tue, 10 Oct 2019 09:19:47 GMT
Etag: "54d9749e-460b"
Server: bfe/1.0.8.18
HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 17931
Content-Type: text/html
Date: Tue, 10 Oct 2019 09:19:47 GMT
Etag: "54d9749e-460b"
Server: bfe/1.0.8.18