Back to HTTP Headers
Both

HTTP Connection Header

Controls whether the network connection stays open after the current transaction. HTTP/2 and HTTP/3 prohibit using this header for connection management.

Purpose

Manages network connection behavior, primarily whether to keep the connection alive for subsequent requests.

Connection: keep-alive Connection: close Connection: upgrade

Code Examples

See how to use the Connection header in different tools and languages.

curl -H "Connection: keep-alive" https://api.example.com/data
curl -H "Connection: close" https://api.example.com/data

Related Headers

Test Your APIs

connection headerhttp connectionhttp headers guide