Answers for "curl content type error"

PHP
0

curl error handling

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $your_url);
curl_setopt($ch, CURLOPT_FAILONERROR, true); // Required for HTTP error codes to be reported via our call to curl_error($ch)
//...
curl_exec($ch);
if (curl_errno($ch)) {
    $error_msg = curl_error($ch);
}
curl_close($ch);

if (isset($error_msg)) {
    // TODO - Handle cURL error accordingly
}
Posted by: Guest on May-17-2021
0

curl content-type

curl 'https://httpbin.org/post' -H 'Content-Type: application/x-www-form-urlencoded' -d 'param1=value1&param2=value2'
Posted by: Guest on August-27-2021

Browse Popular Code Answers by Language