0

I have the following get in my restlet app:

 @Get
public String represent(Variant variant) throws ResourceException
{
    String text = "returntext";

    text+="\r\n";
    return text;
}

When checking the response from invoking this service, I get the following:

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

Shouldn't the Connection be: closed as opposed to keep-alive?

I think is causing the connection to get tied up because I can only invoke the service once.

Atma
  • 29,141
  • 56
  • 198
  • 299
  • Looks like your client/client-program is sending HTTP 1.1 request. In many libraries that send HTTP 1.1 request, the connection header has value `keep-alive` by default. Please see this answer as well: http://stackoverflow.com/questions/6686261/what-at-the-bare-minimum-is-required-for-an-http-request/9734866#9734866 – Abhishek Oza Jul 30 '13 at 08:44

1 Answers1

0

@Ab is correct. http 1.1 has a keep alive. This was the problem.

Atma
  • 29,141
  • 56
  • 198
  • 299