這是pg3.php的 PHP 代碼:
<html>
<body>
<form method="post" action="pg3.php">
<h2><font color="red">::Welcome to Server1: 172.16.24.150::</font></h2>
<input type="text" name="user">
<input type="submit" value="Submit">
</body>
</html>
<?php
if(!empty($_POST["user"])){
echo $_POST["user"];
}
?>
我發送了以下請求:
curl --data "8\r\nuser=mehran\r\n0\r\n" --header "Transfer-Encoding: chunked" "http://172.16.17.10/pg3.php"
我得到以下回復:
<html>
<body>
<form method="post" action="pg3.php">
<h2><font color="red">::Welcome to Server1: 172.16.24.150::</font></h2>
<input type="text" name="user">
<input type="submit" value="Submit">
</body>
</html>
如上所示,user=meh不在回應中,但如果 Transfer-Encoding 正常作業,它必須在那里。
有什么問題??TNX。
uj5u.com熱心網友回復:
請參閱檔案中的此示例:
你發送一個帶有 curl 的分塊 POST ,如下所示:
curl -H "Transfer-Encoding: chunked" -d "payload to send" http://example.com
您無需嘗試自己創建分塊編碼的有效負載。在你的情況下:
curl --data "user=mehran" --header "Transfer-Encoding: chunked" "http://172.16.17.10/pg3.php"
足以curl發送:
POST / HTTP/1.1
...
Transfer-Encoding: chunked
Content-Type: application/x-www-form-urlencoded
b
user=mehran
0
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/372642.html
