parameters 如何在HTTP POST請求中發送參數?
3
Answers
內容放在HTTP頭之後。 HTTP POST的格式是具有HTTP標頭,後跟空行,後跟請求主體。 POST變量作為鍵值對存儲在主體中。
您可以在HTTP Post的原始內容中看到此內容,如下所示:
POST /path/script.cgi HTTP/1.0
From: frog@jmarshall.com
User-Agent: HTTPTool/1.0
Content-Type: application/x-www-form-urlencoded
Content-Length: 32
home=Cosby&favorite+flavor=flies
你可以使用像Fiddler這樣的工具來查看這個工具,你可以使用它來觀察通過線路發送的原始HTTP請求和響應有效載荷。
http post parameters request uri
在HTTP GET請求中,參數作為查詢字符串發送:
http://example.com/page?parameter=value&also=another
在HTTP POST請求中,參數不會與URI一起發送。
價值在哪裡? 在請求頭中? 在請求正文中? 它是什麼樣子的?
1113 votes
http
您無法直接在瀏覽器網址欄上輸入。
例如,您可以看到如何使用Live HTTP Headers在Internet上發送POST數據。 結果會是這樣的
http://127.0.0.1/pass.php
POST /pass.php HTTP/1.1
Host: 127.0.0.1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Referer: http://127.0.0.1/pass.php
Cookie: passx=87e8af376bc9d9bfec2c7c0193e6af70; PHPSESSID=l9hk7mfh0ppqecg8gialak6gt5
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 30
username=zurfyx&pass=password
它說的地方
Content-Length: 30
username=zurfyx&pass=password
將成為職位價值觀。
http1
1111