An example of a Curl request with connection and keep-alive headers. The Connection header is passed with the -H "Connection: keep-alive" command-line parameter. The Keep-Alive header is passed with the -H "Keep-Alive: timeout=5, max=100" command-line parameter.
The Connection header controls whether the current connection remains open after the transaction.
Persistent connections allow sending multiple requests without opening a new connection for every single transaction.
The connections are persistent by default for HTTP/1.1 clients.
For HTTP/1.0 connections, you need to pass the "Connection: keep-alive" request header to explicitly indicate that you want a persistent connection.
What is TCP Timeout?
TCP keepalive timeout defines the interval during which the TCP connection checks the FCIP channel to ensure that a failure is detected quickly even if the channel is inactive. TCP keepalive is a function to send a test probe to the other side when there is no traffic to find out that the track is still there, up and running. Use --keepalive-time to show how much you want the probe to be sent to the partner in seconds.
Generate Code Snippets for Curl Keep Alive Connection Header Example