Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm trying to get an image from Google but...

wp_remote_get returns me:

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"

I don't know why:

  • when I enter the url directly I do get results.
  • all other wp_remote_gets in the same class work ok so yes php.ini allow=ok

this is the code i run:

$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)));

hmmm

share|improve this question
    
ah... it is the https ... doesnt like that –  edelwater Feb 8 '11 at 2:05

1 Answer 1

up vote 3 down vote accepted

Yep, I experienced that under some network configurations https links fail (my case was behind proxy server).

You can use Core Control plugin to test available HTTP transports and disable glitchy one. In my case bumping transport to curl solved issue.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.