void send_request(){
//client.println("POST /tables/arduino_table HTTP/1.1");
//client.println("Host: tremortest1.azurewebsites.net");
//client.println("Content-Type: application/json");
char value[]="IRTHE";
Serial.print("sending ");
Serial.println(value);
// POST URI
sprintf(buffer, "POST /tables/%s HTTP/1.1", table_name);
client.println(buffer);
// Host header
sprintf(buffer, "Host: %s", server);
client.println(buffer);
// Azure Mobile Services application key
//sprintf(buffer, "ZUMO-API-VERSION: %s", ver);
//client.println(buffer);
// JSON content type
client.println("Content-Type: application/json");
// POST body
sprintf(buffer, "{\"value\": %d}", value);
// Content length
client.print("Content-Length: ");
client.println(strlen(buffer));
}
我正在尝试通过以下代码向Azure中的现有表添加值:
有人可以帮我写一下Arduino的POST请求吗?