WordPress getting data from external API

If the API requires an authorization as Bearer token, just write is as Bearer and not as Basic: $headers = array( ‘Content-Type’ => ‘application/x-www-form-urlencoded’, ‘Authorization’ => ‘Beaerer Base64enodedusercredentials’, ); Also take a look at the documentation of this API. Also, make sure that you are currently duplicating the feedback in both of your functions. The … Read more

wp_http remote request not respecting timeout

I suspect this is the cause in the Requests library that powers WP_HTTP: Transfer & connect timeouts, in seconds & milliseconds cURL is unable to handle timeouts under a second in DNS lookups, so we round those up to ensure 1-999ms isn’t counted as an instant failure. The code looks to be here: https://github.com/WordPress/Requests/blob/90db63ab54449c071fc2192a4fc3487cafbf67d0/src/Transport/Curl.php#L448-L460 if … Read more

How can I interact with a third party service that sends POST requests to me in response to the order information that I send them?

Since I doubt “pretty” URLs are important here, it’s incredibly easy to create an endpoint/handler using the AJAX api (the other option is to use the rewrite API and listen out for a hit). Don’t be put off by the term “AJAX” – this is simply a script within your WordPress install that will fire … Read more

error code: 523