A primer on how to use the HTTP API in WordPress for remote communication. Learn best practices, review different web service approaches, and watch a practical example copy a post from one WordPress install to another using XML-RPC.
the HTTP request. wp_remote_get() Retrieve the raw response from the HTTP request using the GET method. wp_remote_post() Retrieve the raw response from the HTTP request using the POST method. wp_remote_head() Retrieve the raw response from the HTTP request using the HEAD method. Friday, November 2, 12
raw response. wp_remote_retrieve_response_code() Retrieve the HTTP stats response code from the raw response. wp_remote_retrieve_response_messsage() Retrieve the HTTP status response message from the raw response. wp_remote_retrieve_body() Retrieve only the body from the raw response. Friday, November 2, 12
error_log( sprintf($errorlog,__("$post_id was not found.")) ); return false; } Log an error, and bail with a boolean result of false Friday, November 2, 12
'post_title' => "{$post->post_title} Copy", 'post_content' => $post->post_content, 'post_status' => 'draft', 'comment_status' => $post->comment_status, 'ping_status' => $post->ping_status, ); Duplicate the data for the $content argument of the request Friday, November 2, 12
WordPress http://planetozh.com/blog/2009/08/how-to-make-http-requests-with-wordpress/ A Note on WP_Http and HTTP Requests in WordPress http://kovshenin.com/2011/a-note-on-wp_http-and-http-requests-in-wordpress/ WP_Http class wp-includes/class-http.php WP_Http functions wp-includes/http.php Friday, November 2, 12