我有一個關於POST HTTP請求,這裏的情況: (主機和這裏使用的鏈接是啓動並運行)HTTP請求和響應參數
POST /inventory-check.cgi HTTP/1.1
Host: www.joes-hardware.com
Accept-Encoding: identity
Content-Length: 7
Content-Type: text/plain
item=563
當我上面的請求字符串發送到主機,然後服務器送我奇怪的東西(預計結果一起)
HTTP/1.1 200 OK
Date: Thu, 31 Oct 2013 12:07:48 GMT
Server: Apache/2.2.22 (Unix) DAV/2 FrontPage/5.0.2.2635 mod_ssl/2.2.22 OpenSSL/1.0.1c
Transfer-Encoding: chunked
Content-Type: text/html
6b
<HTML><BODY>
<H1>Joe's Hardware Store Inventory Check</H1>
Yes! Item number 56 is in stock!
</BODY></HTML>
0
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>501 Method Not Implemented</title>
</head><body>
<h1>Method Not Implemented</h1>
<p>3 to /index.html not supported.<br />
</p>
<hr>
<address>Apache/2.2.22 (Unix) DAV/2 FrontPage/5.0.2.2635 mod_ssl/2.2.22 OpenSSL/1.0.1c Server at totty.temp.veriohosting.com Port 80</address>
</body></html>
我檢查用的urllib模塊請求蟒蛇,讓我只期望輸出(這裏我省略了響應的細節)
<HTML><BODY>
<H1>Joe's Hardware Store Inventory Check</H1>
Yes! Item number 56 is in stock!
</BODY></HTML>
我在想什麼? Actully我是新來的HTTP和有經驗的C/C++/python ...任何幫助將不勝感激..在此先感謝
請注意,您發送無用的Accept-Encoding參數(無害)。 –