curl https timeout code example

Example: 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.

Tags:

Php Example