【问题标题】:restlet get not sending close responserestlet 没有发送关闭响应
【发布时间】:2013-07-29 21:09:29
【问题描述】:

我的 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。另请参阅此答案:stackoverflow.com/questions/6686261/…

标签: http restlet http-get restlet-2.0


【解决方案1】:

@Ab 是正确的。 http 1.1 有一个保持活动状态。这就是问题所在。

【讨论】:

    猜你喜欢
    • 2014-06-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-21
    • 2018-01-20
    • 1970-01-01
    • 2017-12-07
    相关资源
    最近更新 更多