wp_remote_post sends empty body

The following code worked source. The ‘Content-Type’ => ‘application/json’ header was missing causing the problem $url=”myAPIURL HERE”; $username=”apiuser”; $password = ‘passwd’; $headers = array( ‘Authorization’ => ‘Basic ‘ . base64_encode( “$username:$password” ), ‘Content-Type’ => ‘application/json’ ); $fields = array( ‘body’ => json_encode( array( ’email’ => ‘[email protected]’, ‘name’ => ‘Pixelbart’, ‘password’ => ‘Pass#your!word’ ) ), ‘headers’ … Read more

How to use the HTTP API with a Proxy?

The proxy settings work just like a regular HTTP requests but in this case obviously routed through a proxy. In terms of WordPress the API’s transport layers all support proxy connections(fsockopen, fopen, cURL, ). The things about proxy configurations are they come in several flavors and each setup is different so it makes answering this … Read more