Sending cURL error


I’m trying to send this cURL to deactivate IPv6 but I get error: {“success”:false,“errors”:[{“code”:1007,“message”:“Invalid value for zone setting, ipv6”}],“messages”:[],“result”:null}

Php code:

    $ch = curl_init();
    $data = '{"value":"off"}';
    curl_setopt($ch, CURLOPT_URL, "");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");

    $headers = [ 
	    'X-Auth-Email: myemail',
	    'X-Auth-Key: mykey',
	    'Content-Type: application/json'
    curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
	curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    $result = curl_exec($ch);
    echo "Result: " . $result;

What is the problem (mykey and myemail are edited)?


It looks ok to my untrained eye. Have you tried the same curl command from the command line?


Solved by sending the cURL through the CMD. It was very easy than through PHP :smile: