Keep-Alive Connection Example [Java Code]

This page shows how to establish a persistent connection to a server using the Connection and Keep-Alive headers. The -H "Connection: keep-alive" request header indicates that the client requires a persistent connection. The -H "Keep-Alive: timeout = 5, max = 100" request header sets the timeout value. In this Keep-Alive Connection example, we have sent a request to the ReqBin echo URL. Click Send to execute the request online and see the result. The Java code was automatically generated for the Keep Alive Connection example.
Loading...