Inconsistencies between wp_remote_post and cURL
As discovered above, headers need to be (seems so obvious now) key-value pairs, as opposed to an array of json-style key-values: $headers = array(); $headers[‘Content-Type’] = ‘application/json’; $headers[‘Api-Key’] = ‘{myapikey}’; $headers[‘Siteid’] = ‘99999’; And the body needs to be json so either: ‘body’ => “{\n \”Username\”: \”Siteowner\”,\n \”Password\”: \”apitest1234\”\n}” or ‘body’ => json_encode(array( ‘Username’ => … Read more