using wp_remote_get to retrieve own url on local host

I have a website in local development at test:8888 and I am trying to get the following to work in my functions.php file. $response = wp_remote_get( ‘test:8888/?p=1’ ); print_r($response); Unfortunately this is printing WP_Error Object ( [errors] => Array ( [http_request_failed] => Array ( [0] => A valid URL was not provided. ) ) [error_data] … Read more

Extending WordPress REST API

I’m trying to create an API where external clients can authenticate users and reset their password through a REST API. I’ve already seen this: External WordPress API. However, it looks like this is not possible through the this plugin. Are there any way of extending this API with my own methods? How would one implement … Read more

wp_remote_post with ssl:// protocol

$response = wp_remote_post( ‘ssl://’, array( ‘method’ => ‘POST’, ‘body’ => $string, // variable is set ‘timeout’ => apply_filters( ‘http_request_timeout’, 15), ‘sslverify’ => true )); error_log(print_r($response, TRUE)); if ( is_wp_error($response) ) { return FALSE; } $result = wp_remote_retrieve_body($response); The result is an error: [30-Aug-2011 21:53:53] WP_Error Object ( [errors] => Array ( [http_request_failed] => Array ( … Read more

How to set charset for wp_remote_post request?

I’m using wp_remote_post() on a project and it works great. But seems like the server on which I need to make the POST request is a Windows (ISS) server. So the third-party service that provides this specific endpoint requires that all POST requests has a Windows-1252 character encoding, otherwise there will be issues with special … Read more

Is it possible to process $_POST / inbound http request in way to automatically create WordPress post?

I like to learn some of WP automation. The WP get inbound http request to site url and the question is how to create a publication based on post (or get) data structure? How can maintain eventhandler for this and take string from the array of $_POST? to make all of this wp_insert_post( array( ‘post_title’ … Read more

How to duplicate a curl XML request using HTTP API?

I am working on a plugin that posts an XML request to a vendor’s shipping API to get shipping quotes. The XML is stored in a string called $xml. I can post the XML request successfully with curl using these parameters: $curl = curl_init( $this->settings[‘api_url’] ); curl_setopt( $curl, CURLOPT_HEADER, 0 ); curl_setopt( $curl, CURLOPT_POST, 1 … Read more