2
votes

When I send a header request to some servers I have two situations , either 1) no content-length response is available which indicated a chunked data, if so then Connection : keep-alive response is available 2) Content-Length is available , however Connection: keep-alive is not,

In the second case does that mean the connection is dropped or is it kept alive with default timeout and max connection settings , thats is why it is not sent.

I really need to make sure the connection is kept alive , for further testing.

I send a Connection : keep-alive every time I make a request ,

Please Help??

1
The decision to keep a connection alive is up to the server. A client can request that it be left open, but the server makes the final decision if it should be - otherwise it'd be trivial to overload a server with open-and-never-will-closed connections.Marc B

1 Answers

2
votes

For HTTP/1.1 connections, keep-alive is the default. Because of this, the "Connection: keep-alive" header is only useful for HTTP/1.0 connections. So unless the client specifically asks for "Connection: close", the server will (usually) keep the connection open for further requests.