Wp Remote get with manual redirect

Taking a look at the WordPress HTTP API, it seems there ain’t no simple way to do this. In fact, it might even be a calling for a trac ticket. See, although it allows you to specify the maximum number of redirects, there’s no abstract option to control if redirects should even be followed. So …

Read more

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