Articles of http api

Does WordPress's HTTP API use any caching?

I’m working on a plugin to will retrieve data from a remote server and display it on the Dashboard. To do this, I’ll be using the WordPress HTTP API but I’m not seeing any information on the HTTP API using any form of caching. As I don’t want my plugin to cause problems for the […]

Error timed out with succesfull wp_remote_post

What I’m trying to do: Passing POST data by using wp_remote_post. foreach ( $articles as $article_id ) { $postarray = array( ‘method’ => ‘POST’, ‘timeout’ => 5, ‘redirection’ => 5, ‘httpversion’ => ‘1.0’, ‘blocking’ => true, ‘headers’ => array(), ‘body’ => array( ‘article_id’ => $article_id ), ‘cookies’ => array() ); $response = wp_remote_post($url, $postarray); if […]

What's the best way to detect referrer?

I’ve been searching for some WP specific way to detect any referrer. Have an idea? I know how to do that in PHP but I just want to know if there’s some WP function to do that? EDIT: here is what I ‘m trying to test => $referer = wp_get_referer(); if ( strpos($referer ,’http://wordpress.org’) !== […]

Connect external web app to wordpress

We have a web app that will allow users to edit their videos; and add intros, outros, and watermarks. Once the user already done on their video. We need to provide an option to post or syndicate their video as a draft on their WordPress site. Our plan is to create a WordPress plugin that […]

Inconsistent server code response using HTTP API

I’m using WordPress http api to get a server response code from youtube api so I check the validity of a video. I do this in a function from my functions.php which processes my post form where I collect the url of the youtube video. The issue is I’m getting inconsistent responses as where videos […]

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 […]

Sending JSON string through wp_remote_post()

I’m building a mailchimp integration and they require a POST call with JSON code. No, I’m using this code that actually works: $data = wp_remote_post($url, array( ‘headers’ => array(‘Content-Type’ => ‘application/json; charset=utf-8’), ‘body’ => json_encode($array_with_parameters), ‘method’ => ‘POST’ )); But, it returns a PHP warning Warning: http_build_query(): Parameter 1 expected to be Array or Object. […]

wp_remote_post with ssl:// protocol

$response = wp_remote_post( ‘ssl://securesite.com’, 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 ( […]

POST to a REST API from a wordpress form

I dont want to use a REST API to publish to wordpress. I want to create a form on a wordpress page which will send a POST to an external REST API. Users will put in their information, and perhaps upload a file. When the press “submit” I want this information to be sent to […]

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 […]