Why is this curl_init php result false?

0

I have the following script:

...    
$fields = http_build_query($data);
$post = curl_init();

$url = $url . '?' . $fields;
curl_setopt($post, CURLOPT_URL, $url);
curl_setopt($post, CURLOPT_POST, 1);
curl_setopt($post, CURLOPT_POSTFIELDS, $fields);

$result = curl_exec($post);

if ($result == false) {
    echo('Curl error: ' . curl_error($post));
}
var_dump($result);

curl_close($post);

I put the var_dump to see the result of $ result. The result is bool (true)

It turns out that it goes in the echo line

On the server that receives the request everything happens, so the result is true, but it insists on entering the line echo

    
asked by anonymous 24.05.2018 / 22:20

0 answers