YouTube API v3 file_get_contents不起作用(无法打开流:HTTP请求失败!HTTP / 1.0 403禁止)

时间:2015-03-04 23:21:17

标签: php http youtube google-api

我遇到了file_get_contents的问题。我无法从googleapis获取数据..

allow_url_fopen 已启用

file_get_contents("https://www.googleapis.com/youtube/v3/channels?part=id&forUsername=name&key=APIS_KEY");

返回:

Warning: file_get_contents(https://www.googleapis.com/youtube/v3/channels?part=id&forUsername=name&key=APIS_KEY): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden

生成了服务器密钥(在localhost上都可以,在我的VPS上没有) 我不知道我能做什么。

其他网站上的

file_get_contents可以使用。

你能帮帮我吗?

0 个答案:

没有答案