Curl GET method
Curl GET method
Curl GET method
$api_url = 'domainname.com/api/demo';
$headers = array(
'Authorization: Bearer Token',
'api-key: 'api_key',
);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $api_url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => $headers,
));
$result = curl_exec($curl);
$response = json_decode($result, true);
0 Comment's
Add Comment
Register to Reply
Login
Register