How do I set a timeout for Curl?

You can set two timeouts for Curl. With the command line parameter -m or --max-time you can set a timeout for the total request time, and with the command line parameter --connect-timeout you can set a timeout for connecting to the server. The waiting time is specified in seconds. This is the time during which the request must be processed or canceled. In this Curl timeout example, we set the timeout for sending requests to the ReqBin echo URL. Click the Run button to execute the Curl Timeout Example online and see the results.
Loading...