0
我在我的Restlet應用程序如下得到:的Restlet得到不發送接近響應
@Get
public String represent(Variant variant) throws ResourceException
{
String text = "returntext";
text+="\r\n";
return text;
}
當檢查調用此服務的響應,我得到如下:
CFG - HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Type: text/plain;charset=UTF-8
Date: Mon, 29 Jul 2013 19:59:37 GMT
Server: Restlet-Framework/2.0.9
Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept
Content-Length: 118
Connection: keep-alive
不應該連接是:關閉而不是保持活動?
我認爲是造成連接堵塞,因爲我只能調用一次服務。
看起來您的客戶端/客戶端程序正在發送HTTP 1.1請求。在許多發送HTTP 1.1請求的庫中,缺省情況下連接頭的值爲「keep-alive」。請參閱以下答案:http://stackoverflow.com/questions/6686261/what-at-the-bare-minimum-is-required-for-an-http-request/9734866#9734866 –