使用此代码时,我的get请求出现400错误请求错误。为什么GET请求失败?
require_once 'inc/ggl/autoload.php';
require_once 'inc/ggl/src/Google/Service/YouTube.php';
require_once 'inc/ggl/src/Google/Client.php';
$client = new Google_Client();
$client->setApplicationName("API_Project");
$client->setDeveloperKey('{MY API KEY}');
$youtube = new Google_Service_YouTube($client);
$videoResponse = $youtube->videos->listVideos('snippet', array(
'id' => '{ANY VIDEO ID}'
));
$vidtitle = $videoResponse['items'][0]['snippet']['title'];
echo $vidtitle;
答案 0 :(得分:0)
我明白了。花括号不应该被包括在内......