Created
September 14, 2016 00:31
-
-
Save aaoliveira/859964d8e90f78372febc5b4cc4457b9 to your computer and use it in GitHub Desktop.
Terceiro exemplo de auth
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl_setopt_array($curl, array( | |
CURLOPT_URL => "https://apic1.hml.stelo.com.br/", | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_ENCODING => "utf-8", | |
CURLOPT_MAXREDIRS => 10, | |
CURLOPT_TIMEOUT => 30, | |
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, | |
CURLOPT_CUSTOMREQUEST => "POST", | |
CURLOPT_HTTPHEADER => array( | |
"authorization: Basic Y2Y4ZGI2ZmU2MWJjMWVmZWJjNmFlNGY1YWI0YWY2MGM6ZjUzOGI3M2ExMWVhYzQ5ODI3ZjZkYTY3OGU4NTlmYTc=", | |
"cache-control: no-cache", | |
), | |
)); | |
$response = curl_exec($curl); | |
$err = curl_error($curl); | |
curl_close($curl); | |
if ($err) { | |
echo "cURL Error #:" . $err; | |
} else { | |
echo $response; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment