Answers for "curl how to handle 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
2

get current time curl

$ date -s `curl -I 'https://google.com/' 2>/dev/null | grep -i '^date:' | sed 's/^[Dd]ate: //g'`
Posted by: Guest on October-16-2020

Browse Popular Code Answers by Language