Connection

The Connection header provides the primary method for connection management in HTTP. There are two values that this header usually uses:

Connection: Keep-Alive 
Connection: Close 

Because a connection can only be open or closed, these two values, when used in HTTP requests and HTTP responses, allow for the handling of all possible scenarios within an HTTP transaction.

One of the most important distinctions between HTTP/1.0 and HTTP/1.1 is how connections are treated. In both versions, persistent connections are supported. However, with HTTP/1.0, persistent connections were not the default behavior, so the use of a Connection: Keep-Alive header requesting persistent connections had to be used. With HTTP/1.1, persistent connections ...

Get HTTP Developer’s Handbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.