using wp_remote_get to retrieve own url on local host

Ad Timeout You should be able to get around the timeout using a filter add_filter( ‘http_request_timeout’, ‘wpse35826_timeout_extd’ ); function wpse35826_timeout_extd( $time ) { // Default timeout is 5 return 10; } Choose the right protocol/scheme About your protocol/scheme problem: If it’s your local install, you can use the conditional. function wpse35826_remote_get( $args ) { $protocol … Read more

What’s the best way to detect referrer?

The best way to check the referrer will depends of what are you trying to do. You can use wp_get_referer() or wp_get_original_referer(), but if you want to check the referer for security reasons you should definitely use other functions like check_admin_referer(), check_ajax_referer(), wp_referer_field() or other of the WordPress Nonces related functions.

Inconsistent server code response using HTTP API

Disclaimer: I can’t give you a real explanation why this happens. I investigated this issue multiple times and (like you) didn’t even get a consistent error behavior. Anyway: Every sort of RESTful remote request using a remote API is painful and error prone – it simply highly depends what the counter part gives you… not. … Read more

Extending WordPress REST API

There are no answers here yet, but atleast we ended up using a combination of WP REST API and WP OAuth Server. The WP REST API was really easy to work with, as it provided a common framework to respond to HTTP requests. I found it similar to ASP.NET Web API, as that’s the framework … Read more

wp_remote_post with ssl:// protocol

This doesn’t seem to be error coming from WP itself, but is likely generated by curl, which WP likes to pick first for network requests. I’d try to replicate request with curl by hand on your hosting and elsewhere. If you are content with doing network request in other way you can tweak to make … Read more

How to set charset for wp_remote_post request?

After trying several times to set the proper charset, I wasn’t successful. Then I searched for an workaround and found one that worked with my problem. In addition to set the charset like I mentioned above, what I did is to convert all strings on my POST body with this php snippet: $message = @iconv(“UTF-8″,”Windows-1252//IGNORE”,$message); … Read more