I’m trying to send a simple http request, see example
http://script.google.com/macros/s/--PUB-SCRIPT-ID--/exec?col1=1&col2=‘pizza’
to enter data into a google spreadsheet following the code explained at http://stackoverflow.com/questions/16633154/how-to-post-to-google-docs-form-directly
When I enter the request into a browser it writes the data into the google table. When doing so in code the server answers with a Bad request. Any ideas?
if (client.connect("script.google.com", 80))
{
client.println("POST /macros/s/--PUB-SCRIPT-ID--/exec?col1=23&col2=33 HTTP/1.1");
client.println("Host: script.google.com");
client.println("Connection: close");
client.println();
while (client.available()) //Read what is returned from the server
{
char c = client.read();
if (millis() - lastSync > 500) continue; //Read for maximum 500ms, then continue
}
client.flush();
client.stop();
}