I'm making a GET request, via postman, and it works normally.
When in localhost, it works too.
But when on air, on a server, it seems that the destination site blocks the request.
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.americanas.com.br/produto/133731106/smartphone-samsung-galaxy-j8-64gb-dual-chip-android-8-0-tela-6-octa-core-1-8ghz-4g-camera-16mp-f1-7-5mp-f1-9-dual-cam-preto",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"Postman-Token: e35899dd-3555-4b2d-bcf9-f533d301eeb1",
"cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>