Answers for "curl timeout"

PHP
2

php curl timeout

curl_setopt($ch, CURLOPT_TIMEOUT, 5); //timeout in seconds
#curl_setopt($ch, CURLOPT_TIMEOUT_MS, 5000); //timeout in Milliseconds
Posted by: Guest on March-05-2021
1

Curl default connect-timeout

The default connect timeout value seems to be 5 minutes / 300 seconds according to the DEFAULT_CONNECT_TIMEOUT macro in lib/connect.h.

On Debian it stops trying to connect after 2 minutes, regardless of the time specified with --connect-timeout 

A default value for --max-time doesn't seem to exist, making curl wait forever for a response if the initial connect succeeds.

curl has two options: --connect-timeout and --max-time.
Posted by: Guest on December-09-2020

Browse Popular Code Answers by Language