[wp-trac] [WordPress Trac] #37888: wp_remote_get() problems after upgrade to 4.6
WordPress Trac
noreply at wordpress.org
Tue Aug 30 16:52:04 UTC 2016
#37888: wp_remote_get() problems after upgrade to 4.6
-----------------------------+-----------------------------
Reporter: differentthemes | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: HTTP API | Version: 4.6
Severity: normal | Keywords:
Focuses: |
-----------------------------+-----------------------------
Just upgraded my WordPress from 4.5.3 to 4.6 and
{{{
wp_remote_get('http://www.geoplugin.net/json.gp?ip=8.8.8.8');
}}}
stopped working, the response I get is
{{{
Array
(
[headers] => Requests_Utility_CaseInsensitiveDictionary Object
(
[data:protected] => Array
(
[date] => Tue, 30 Aug 2016 16:45:15 GMT
[content-type] => text/html; charset=iso-8859-1
[content-length] => 209
[server] => Apache
)
)
[body] => Forbidden
You don't have permission to access /json.gp
on this server.
[response] => Array
(
[code] => 403
[message] => Forbidden
)
[cookies] => Array
(
)
[filename] =>
[http_response] => WP_HTTP_Requests_Response Object
(
[response:protected] => Requests_Response Object
(
[body] => Forbidden
You don't have permission to access /json.gp
on this server.
[raw] => HTTP/1.1 403 Forbidden
Date: Tue, 30 Aug 2016 16:45:15 GMT
Content-Type: text/html; charset=iso-8859-1
Content-Length: 209
Connection: close
Server: Apache
Forbidden
You don't have permission to access /json.gp
on this server.
[headers] => Requests_Response_Headers Object
(
[data:protected] => Array
(
[date] => Array
(
[0] => Tue, 30 Aug 2016
16:45:15 GMT
)
[content-type] => Array
(
[0] => text/html;
charset=iso-8859-1
)
[content-length] => Array
(
[0] => 209
)
[server] => Array
(
[0] => Apache
)
)
)
[status_code] => 403
[protocol_version] => 1.1
[success] =>
[redirects] => 0
[url] => http://www.geoplugin.net/json.gp?ip=8.8.8.8
[history] => Array
(
)
[cookies] => Requests_Cookie_Jar Object
(
[cookies:protected] => Array
(
)
)
)
[filename:protected] =>
[data] =>
[headers] =>
[status] =>
)
)
}}}
In case I replace the
{{{
wp_remote_get('http://www.geoplugin.net/json.gp?ip=8.8.8.8');
}}}
with
{{{
file_get_contents('http://www.geoplugin.net/json.gp?ip=8.8.8.8');
}}}
All works fine, also if I run the
{{{
wp_remote_get('http://www.geoplugin.net/json.gp?ip=8.8.8.8');
}}}
on WP 4.5.3 or older, all works fine.
What has changed?? Am I missing something or is this a bug?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37888>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list