skip to Main Content

PHP curl to github rest api does not return anything

Based on https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28 I have this code: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://api.github.com/repos/octocat/Hello-World/commits"); $headers = [ 'Accept: application/vnd.github+json', 'Authorization: Bearer <my personal token>', 'X-GitHub-Api-Version: 2022-11-28' ]; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $server_output = curl_exec($ch); curl_close($ch); print $server_output ; But it does not…

VIEW QUESTION
Back To Top
Search