Created
January 8, 2019 12:20
-
-
Save carlosleonam/a6036a4adcc6b77e3fe8204fee199e71 to your computer and use it in GitHub Desktop.
Consulta de retorno da API da PROCOB (https://api.procob.com)
This file contains hidden or 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
<?php | |
/** | |
* @Author: SisSoftwares WEB (Sistemas PHP) | |
* @Date: 2019-01-08 08:16:58 | |
* @Last Modified by: Usuario | |
* @Last Modified time: 2019-01-08 08:20:51 | |
*/ | |
$curl = curl_init(); | |
curl_setopt_array($curl, array( | |
CURLOPT_URL => "https://api.procob.com/consultas/teste", | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_ENCODING => "", | |
CURLOPT_MAXREDIRS => 10, | |
CURLOPT_TIMEOUT => 30, | |
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, | |
CURLOPT_CUSTOMREQUEST => "GET", | |
CURLOPT_HTTPHEADER => array( | |
"authorization: Basic c2FuZGJveEBwcm9jb2IuY29tOlRlc3RlQXBp" | |
), | |
)); | |
$response = curl_exec($curl); | |
$err = curl_error($curl); | |
curl_close($curl); | |
echo "<pre>"; | |
if ($err) { | |
echo "cURL Error #:" . $err; | |
} else { | |
// echo $response; | |
var_dump( json_decode( $response, $assoc_array = false ) ); | |
} | |
echo "</pre>"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment