我正试图从谷歌上获取图像,但。。。
wp\\u remote\\u get返回我:
Could not open handle for fopen() to
https://ajax.googleapis.com/ajax/services/search/images?
v=1.0&q=whatever.whatever&key=MYKEYWHICHIDONTPOST&userip=127.0.0"
我不知道为什么:
当我直接输入url时,我确实会得到结果所有其他wp\\u remote\\u都在同一个类中完成了工作,好吧,是的,php。ini allow=ok这是我运行的代码:
$referer_url = get_bloginfo(\'url\');
$referer = $parsed_url[host];
$google_images_url = self::GOOGLE_IMAGES_URL . "&q=" . $url_to_look_for . "&key=" . $key . "&userip=" . $_SERVER[\'REMOTE_ADDR\'];
$response = wp_remote_get($google_images_url, array( \'headers\' => array( \'Referer\' => $referer)));
嗯,嗯