【发布时间】:2017-03-26 00:01:28
【问题描述】:
我正在尝试使用 Github Api 从这个 Api 调用中获取数据。但是,每当我尝试从中获取数据时,都会出现以下错误。我似乎无法弄清楚为什么这不起作用。
我通过 PhpStorm 在本地主机上运行它。
代码:
$url = urlencode("https://api.github.com/users/devinmatte/repos");
$json = file_get_contents($url);
$obj = json_decode($json);
echo $obj;
错误:
[Sat Mar 25 20:02:14 2017] PHP Warning: file_get_contents(https%3A%2F%2Fapi.github.com%2Fusers%2Fdevinmatte%2Frepos): failed to open stream: No such file or directory in /home/devin-matte/Documents/Git-Challenge/index.php on line 13
【问题讨论】:
-
出于好奇,什么是“git挑战”?
-
Git-Challenge 是我正在进行的项目的名称。我正在尝试为学生的 git 存储库做出 Game-ify 贡献。
标签: php json github github-api