The HTTP Connection header is used to control whether an active connection stays in place after a transaction is complete.


The HTTP Connection header dictates whether the network connection remains open after the current transaction. There are two directives: keep-alive and close.


The keep-alive directive indicates that the client wants the HTTP Connection to persist and remain open after the current transaction is complete. This is the default setting for HTTP/1.1 requests.

Connection: keep-alive


The close directive signals that the client wants to close the HTTP Connection, post-transaction. This is the default setting for HTTP/1.0 requests.

Connection: close


As of HTTP/2, the HTTP Connection header is no longer valid. Some browser implementations ignore the HTTP header whereas others will reject messages that contain it.


In earlier implementations of HTTP, the HTTP Connection header was used to control what happened to the HTTP connection after the current transaction was complete. As of HTTP/2, it is no longer used.

See also

Last updated: June 2, 2022