HTTP headers | Connection (original) (raw)

Last Updated : 7 Nov, 2019

The HTTP Connection header is a general type header that allows the sender or client to specify options that are desired for that particular connection. Instead of opening a new connection for every single request/response, Connection helps in sending or receiving multiple HTTP requests/responses using a single TCP connection. It also controls whether or not the network stays open or close after the current transaction finishes. Syntax:

Connection: keep-alive Connection: close

Directives: This HTTP Connection header accept two directives mentioned above and described below:

Note: Both the directives are also headers that represent the connection in combine. Example:

To check this Connection in action go to Inspect Element -> Network check the header for Connection like below. Browser Compatibility: The browsers are compatible with HTTP Connection header are listed below: