[wp-hackers] Possible bug with HTTP API using cookies

William P. Davis will.davis at gmail.com
Tue Jul 31 01:03:31 UTC 2012

I'm using the HTTP api to get cookie information and then pass it through
in another request. The code works fine on two servers but, as luck would
have it, not on my production server. They all have CURL installed.

The code is:

$cookie = wp_remote_retrieve_headers( wp_remote_post( 'http://example.com'
) );
$body = wp_remote_retrieve_body( wp_remote_post( 'http://example.com',
array( 'body' => $args, 'cookies' => array( 'cookie' => $cookie[
'set-cookie' ] ) ) ) );

And the error:
Fatal error: Call to a member function getHeaderValue() on a non-object in
/var/www/bangordailynews.com/htdocs/wp-includes/class-http.php on line 420

I wanted to see if anybody else can replicate this disparity before I
submit a bug report to trac.


More information about the wp-hackers mailing list