Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [wp-remote-post]

The tag has no usage guidance.

0
votes
2answers
25 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 ...
-1
votes
0answers
18 views

Passing JSON body in wp_remote_post

I tried following this: Sending JSON string through wp_remote_post() But the solution there didn't work for me. Apart of the Microsoft Graph API you need to pass the body of the request as JSON. ...
0
votes
1answer
15 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
27 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
424 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 ...
1
vote
1answer
662 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' => ...
0
votes
0answers
68 views

Cron job cannot use “wp_remote_post”

I've written a script that is running once an hour on my site but it's not working. I've been trying to debug and unfortunately I haven't gotten very far. I'm getting the following error: Uncaught ...
1
vote
0answers
102 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
2k 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
189 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
2k 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
87 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
386 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
905 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
597 views

Does wp_remote_post() require curl?

Does the following code require curl? $response = wp_remote_post( $url, [ 'body' => json_encode( $data ) ] );
-1
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 ...
10
votes
1answer
11k 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
6k 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 ...
3
votes
1answer
5k 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 = ...
2
votes
1answer
3k 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
153 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
3k 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
5k 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
327 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
80 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
803 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 ...