我使用telnet发送一个HTTP请求,就像这样:
telnet> open 192.168.4.135 8087
Trying 192.168.4.135...
Connected to 192.168.4.135.
Escape character is '^]'.
POST /rpc/ HTTP/1.1
HOST:192.168.4.135:8087
Content-length:18
Content-type:application/x-http-form-urlencoded
action=loadrsctype
HTTP/1.1 200 OK
Date: Thu, 17 May 2012 03:52:53 GMT
Content-Length: 45
Content-Type: text/html; charset=ISO-8859-1
return=fail&error=Configuration doesn't existHTTP/1.1 400 Bad Request
Content-Type: text/html
Connection: close
Date: Thu, 17 May 2012 03:52:53 GMT
Content-Length: 94
<HTML><HEAD>
<TITLE>400 Bad Request</TITLE>
</HEAD><BODY>
<H1>Bad Request</H1>
</BODY></HTML>
Connection closed by foreign host.
响应代码是200,但为什么有这样的一段话:
HTTP/1.1 400 Bad Request
Content-Type: text/html
Connection: close
Date: Thu, 17 May 2012 03:52:53 GMT
Content-Length: 94
<HTML><HEAD>
<TITLE>400 Bad Request</TITLE>
</HEAD><BODY>
<H1>Bad Request</H1>
</BODY></HTML>
这是服务器或telnet本身的输出? 如何避免以显示这个?
--update--当我改变“HTTP / 1.1”,以“HTTP / 1.1”,我得到正确的反应。 现在我不知道wheather这是协议的要求,或与服务器的实现有关系吗?