Example:
String postData = "name=Alice&age=12";
client.beginRequest();
client.post("/");
client.sendHeader("Content-Type", "application/x-www-form-urlencoded");
client.sendHeader("Content-Length", postData.length());
client.sendHeader("X-Custom-Header", "custom-header-value");
client.beginBody();
client.print(postData);
client.endRequest();
Your code:
client.beginRequest();
client.post("/v1.1/messages"); //, contentType, buf
client.sendHeader("Authorization", AuthorizationData);
client.sendHeader("Content-Type", "application/json");
client.sendHeader("Content-Length", len);
client.endRequest();
client.print(buf);
No, it is not a server problem, your code is wrong. You're sending data after you ended the request, and you don't finish the header or start the body.