http://myname.appspot.com/query?city=Co ... id=ESP8266
But I cannot get it to work on the ESP8266. Here is my code:
const char* MY_URL = "http://myname.appspot.com";
void uploadHTTP() {
// Define the WiFi Client
WiFiClient client;
// Set the http Port
const int httpPort = 80;
// Make sure we can connect
if (!client.connect(MY_URL, httpPort)) {
return;
}
else {
Serial.println("Connected to MY_URL");
}
String url = "/query?city=Copenhagen&temp=20&id=ESP8266";
// Post to appspot
if (client.connect(MY_URL, httpPort)) {
// Sent HTTP POST Request
client.println("POST " + url + " HTTP/1.1");
Serial.println("POST " + url + " HTTP/1.1");
client.println("Host: " + String(MY_URL));
Serial.println("Host: " + String(MY_URL));
client.println("User-Agent: Arduino/1.0");
Serial.println("User-Agent: Arduino/1.0");
client.print("Content-Length: ");
Serial.print("Content-Length: ");
client.println(0);
Serial.println(0);
client.println("Content-Type: application/x-www-form-urlencoded");
Serial.println("Content-Type: application/x-www-form-urlencoded");
client.println("Connection: close");
Serial.println("Connection: close");
}
//Done
Serial.println("");
Serial.println("my HTTP done");
Serial.println("");
}