How to send the body in wp_remote_post as “raw”?
I got this one working, you have to pass the json_encoded array on the body parameter of the request. $customer_details = [ ‘first_name’ => $first_name, ‘last_name’ => $last_name, ’email’ => $email, ]; $customer_details[‘body’] = json_encode($customer_details); $customer = $api->createUpdateCustomer($customer_details); public function createUpdateCustomer($customer_details) { $response = $this->apiCall( “2.0/customers”, ‘POST’, $customer_details); $result = json_decode($response); return $result; } public … Read more