connection-header tagged requests and articles

Categorized request examples and articles tagged with [connection-header] keyword
How do I make a Keep-Alive request?
To make a Keep-Alive request, specify a "Connection: keep-alive" HTTP header in the request. The Keep-Alive connection means the server won't close the connection after fulfilling the request. In HTTP 1.1, all connections are considered persistent unless declared otherwise. The servers inform the clients about persistent connections by including the "Connection: keep-alive" header in the server response. In this Keep-Alive Connection Example, we send Connection and Keep-Alive headers to the ReqBin echo URL. Click Send to execute the Keep-Alive Connection example online and see the results.

How to force Curl to close the connection after response?
Curl tries to keep connections open and reuse existing connections. To close a connection after a request, you can send a "Connection: close" HTTP header to the server. The Connection: close header informs the server that the client wants to close the connection after completing the HTTP transaction. It's up to the server to close the connection after the request or not. You can use the- H command-line option to pass the "Connection: close" header to Curl. In this Curl Close Connection example, we send a request to the ReqBin echo URL with the corresponding header. Click Run to execute the Сurl Сommand with Сlose Сonnection Header example online and see the result.

How to send Curl keep-alive request?
Curl keeps connections open and reuses existing ones when possible. If you need to pass the Connection: keep-alive header to Curl, you can use the -H command line option. The Keep-Alive Connection means the server will not close the Connection after making the request. HTTP clients may specify the additional persistent connection options in a separate - H "Keep-Alive: [options]" HTTP header. In this Curl Keep-AliveConnection Example, we send a keep-alive request to the ReqBin echo URL. Click Run to execute the Curl Command with Keep-Alive Connection Header online and see the results.