He did catch traffic with wireshark, and analyzed the packages that they send with the mailman, to see the http headers that he uses.
Guiding me a little there, my code goes like that, but it still does not work, I do not like it and I like the goal or going away
char PostData[] = "{"operation":"core/create","class":"UserRequest","output_fields":"id","comment":"loquesea","fields":{"org_id":"1","title": "prueba_hospital","description":"prueba"}}\r\n";
if (client) {
client.println("POST /itop/web/webservices/rest.php? HTTP/1.1");
client.print("Host: 172.30.31.6\r\n");
client.print("Authorization: Basic YWRtaW46YWRtaW4=\r\n"); // USUARIO Y CONTRASEÑA EN BASE 64
client.print("User-Agent: Arduino/1.8.5\r\n");
client.print("Content-Lenght: ");
client.print(strlen(PostData));
client.print("\r\n");
client.print("Content-Type: application/json\r\n");
client.print("Accept: /\r\n");
client.print("Connection: keep-alive\r\n");
client.print("Content-Disposition: form-data; name="version"\r\n");
client.print("\r\n");
client.print("1.1\r\n");
client.print("\r\n");
client.print("Content-Disposition: form-data; name="json_data"\r\n");
client.print("\r\n");
client.print(PostData);
client.print("\r\n");
Serial.println("Post Realizado");
}else {
Serial.println("No se ha podido hacer el POST");
}
i try with
client.print("Content-Type: application/json\r\n");
and
client.print("Content-Type: application/x-www-form-urlencoded\r\n");
But i have not got possitive results