Questions tagged [wp-remote-post]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
18 views

Inconsistencies between wp_remote_post and cURL

I can successfully make the RESTful post using cURL: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.mindbodyonline.com/public/v6/usertoken/issue'); curl_setopt($ch, ...
0
votes
0answers
30 views

cURL error 7: Failed to connect to XXX.XXX.X.XXX port 3000: Connection timed out - wp_remote_post

I'm using wp_remote_post() for POST WordPress posts to external api, but it shows below error: WP_Error Object ( [errors] => Array ( [http_request_failed] => Array ( [0] => cURL error 7: ...
0
votes
1answer
19 views

Publish page remotely

Is it possible to publish a page to WordPress remotely? Example diagram:
0
votes
1answer
19 views

wp_remote_post code conversion

I'm trying to convert this php code to the wordpress wp_remote_post() format. Thoughts, Ideas, This is NOT my forte, lol. <?php require_once 'HTTP/Request2.php'; $request = new HTTP_Request2(); $...
0
votes
1answer
55 views

How to send the body in wp_remote_post as “raw”?

I'm not sure if I'm asking the right question, so here is the context. I'm making a POST to an API (The api is to a Google Sheets Script - so there are some unusual limitations). When I use postman ...
0
votes
0answers
20 views

problem using wp_remote_post

I am sending the following request $params['upload'] = new CURLFile( $file_path ); $args = array( 'method' => 'POST', 'headers' => $headers, 'body' =>...
0
votes
0answers
19 views

Is there any way to get a variable for $current_user password to send a post request to endpoint?

I've tried the code below but wordpress only send the hash password, so the endpoint response is 404 (not found). function identify_user() { $url = 'http://spring-app-build:8080/api/auth/login'; if (...
1
vote
1answer
21 views

How to create custom post by using REST API securely?

I am new to this. Figuring out how to use it. I am trying to create a custom post by filling out a frontend form. I am using ajax button in the form. This button triggers wp_remote_post().I have the ...
1
vote
0answers
73 views

Sending post request with wp_remote_post not working correctly

I need to submit a form on the woo-commerce product page via restful API custom endpoint the problem is the wp_remote_post not working correctly with me or me mostly I did something wrong. The form ...
0
votes
1answer
131 views

How to convert this cURL to wp_remote_*?

My function below includes a cURL call which throws a text string at a Google Cloud text analysis API, returning a response object, which we then parse to get a specific piece. It has been ...
0
votes
0answers
222 views

Send POST request to Flask app from functions.php file

I have an endpoint on my Flask app that I can hit via Postman and it works fine. However, when I write the POST request in my functions.php file and trigger it via button press, my server returns a ...
0
votes
1answer
48 views

Generate new post from email

I have a wordpress site that allows users to set their location when they are logged in, and then uses the heartbeat API to their door display. However, I have had to build in the role of managers ...
0
votes
0answers
117 views

wp_remote_post To external API multiple values with the same key

I am trying to create a WP plugin that calls an external API using HTTP POST. I am using wp_remote_post and my arguments look like this: $body = array( 'CustomerID' => '10', 'Items' => [...
0
votes
2answers
2k views

How to send a HTTP Post request using PHP Curl and Wordpress

I am working on a script to bring in an xml file from another server via Post request, This would then return another xml of data which I can then store into a wordpress database depending on certain ...
0
votes
1answer
170 views

API getting null values with wp_remote_post

I'm trying to post some data to an API and I keep getting null values in the fields. My PHP code: $url = 'https://apiconnector.com/v2/address-books/136517/contacts'; $username = 'apiuser'; $...
1
vote
0answers
223 views

wp_remote_request header error even though working properly with cURL

I'm trying to make calls to a JSON API inside my wordpress theme. I tried with the cURL option, making a custom function and things works as it should but I wanted to use the built-in wordpress ...
1
vote
1answer
3k views

Stuck with wp_remote_post sending data to an external api on user registration

I am trying to create a basic plugin to send user details to a CRM when a user signs up on the WordPress website as a basic subscriber. I have reached a sticking point, I have tried to interpret the ...
2
votes
1answer
3k views

Wp_remote_post not posting data

This works in php: $postdata = http_build_query( array( 'api' => get_option('API_key'), 'gw' => '1' ) ); $opts = array('http' => ...
1
vote
0answers
138 views

wp_remote_post - handling responses

I need to add a form to my WordPress site that will post its data to an external API without ever storing the form data in the mysql database. I also need to show components of the response from the ...
2
votes
1answer
3k views

wp_remote_post doesn't work with more than 1024 bytes in the body

What I need I'm working with a third-party API (for the intents of this question, it's irrelevant which one) and need to send a POST request to an external service. I'm trying to use wp_remote_post ...
0
votes
1answer
213 views

wp_remote_post rabobank omnikassa (version2) - error 5001

i am actually not sure if this should be a wordpress question/issue or should be asked elsewhere (but one thing might cause the other..) in any event, trying to write a custom rabobank omnikassa ...
4
votes
3answers
4k views

Send data to 3rd party api with wp_remote_post on wp_login

Is it possible to use wp_remote_post to send http post requests to 3rd party api's? I wasn't able to successfully save the user object as a javascript variable, so I was hoping I could make an http ...
3
votes
3answers
2k views

Difference between wp_remote_post and wp_safe_remote_post

The documentation for wp_remote_post says In many cases you may be better served with wp_safe_remote_post Looking at the source code, the only line that's different between the two is that ...
4
votes
3answers
138 views

Log in from one wordpress website to another wordpress website

My client explicitly does not want to use 'multisite' wordpress option. My client has a main site and 199 sub sites (other domains). A user has usermeta with meta key: branch_id As an example (...
2
votes
1answer
477 views

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 ...
1
vote
1answer
1k views

How to send file by wp_remote_post?

I don't want cURL in my WordPress plugin Hi, cURL is not safe to use on WordPress site. And sometime, cURL has been disable on customer hosting. And i decided to use wp_remote_post to send file for ...
0
votes
0answers
695 views

Does wp_remote_post() require curl?

Does the following code require curl? $response = wp_remote_post( $url, [ 'body' => json_encode( $data ) ] );
0
votes
2answers
1k views

wp_remote_post and form post

Actually it is more general question but now i am trying to use it on wordpress site so I preferred to post it here. I am trying to understand the difference between remote post and form post. When ...
13
votes
1answer
17k views

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('...
1
vote
2answers
3k views

creating form for wp_remote_post

i'm using code from the wordpress codex: (this is the generic version, my code is working though) $response = wp_remote_post( $url, array( 'method' => 'POST', 'timeout' => 45, '...
2
votes
1answer
7k views

Change the headers content type with wp_remote_post

Working with the remote API requests with WordPress. I have used wp_remote_post() function to request the HTTP data but I am unable to update the headers Content-type I am using the following code ...
5
votes
1answer
7k views

How to add Request header in WordPress remote api calls

Hey am new to WP development, can any one tell me how to add request headers in wp_remote_get() or wp_remote_post() remote api calls. I tried the following but didnt work $response = ...
3
votes
1answer
4k views

How can I use CURLOPT_USERPWD in wp_remote_post?

I'm trying to setup a proper cURL call in WordPress so am using wp_remote_post(). However, I'm having trouble authenticating the user via wp_remote_post(). Any idea how to convert the following to be ...
0
votes
1answer
159 views

Post to a server writen in Hapijs from wordpress using wp_remote_post

I'm trying to post to a server written in Hapijs from wordpress using wp_remote_post. I'm getting connection refused and I can't figure out what is wrong. The server is on port 8080. Nb:...
4
votes
1answer
4k views

HTTP request on localhost failing

I have a Wordpress instance on my development box with the WP REST API plugin installed. I am attempting to create my own plugin to use wp_remote_get() to communicate with my own custom PHP ...
3
votes
2answers
7k views

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, '...
0
votes
0answers
4k views

WordPress wp_remote_post() sending informaiton to Redmine REST API

I am having a problem using WordPress's wp_remote_post() function with Redmine's REST API. The main issue is that when I attempt to post, i get a 403 - forbidden return. This is the code that i'm ...
0
votes
1answer
383 views

http_response_timeout filter not working

I am writing a Wordpress plugin that makes calls to external sites. I want to raise the timeout for all wp_remote_* calls, so I added the following to the __construct function of my plugin: ...
0
votes
0answers
81 views

saving file to external server vip

I have a handwritten script that writes a text file locally in one of my Wordpress pages, but now I need it to read and write to a remote server that is password protected and accessible only through ...
2
votes
1answer
1k views

Retrieving Google Plus share count with wp_remote_post

So I've spent most of my morning working on my website's customized social share buttons. Reading out Twitter and Facebook shares were no problem, but Google Plus is a real challenge, as they don't ...
1
vote
1answer
830 views

On Plugin Activation, How Do I Check for Proper Transport Mechanism?

For a plugin that communicates with somewhere else, I hear we're supposed to use wp_remote_post and wp_remote_get instead of PHP's Curl library. Okay, but is there a fast and proper way on plugin ...
2
votes
1answer
2k views

Remote login with only the username not working

I'm writing a module for remote login into another WP site via my plugin's admin. This is the code I'm using on the sender side: <?php add_action('init', 'connect'); function connect() { //I ...