Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header("user-key : 417e013d16933908dab0a30ca8fb5d50",
- "accept : application/json"
- );
- $service_url = 'https://api-endpoint.igdb.com';
- $curl = curl_init($service_url);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- $curl_response = curl_exec($curl);
- if ($curl_response === false) {
- $info = curl_getinfo($curl);
- curl_close($curl);
- die('error occured during curl exec. Additioanl info: ' . var_export($info));
- }
- curl_close($curl);
- $decoded1 = json_decode($curl_response,true);
- if (isset($decoded1->response->status) && $decoded1->response->status == 'ERROR') {
- die('error occured: ' . $decoded1->response->errormessage);
- }
- echo 'response ok!';
- $dumbstr = var_export($decoded1->response);
- print_r($curl_response);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement