Unable to send POST request from Arduino to Google Form -



Unable to send POST request from Arduino to Google Form -

i'm using wifi cc3000 shield , adafruit_cc3000.h library. i'm able connect wifi network , examples work. sketch doesn't :( here loop() function:

void loop() { serial.println("in-loop"); unsigned long ip; cc3000.gethostbyname("docs.google.com", &ip); client = cc3000.connecttcp(ip, 80); if (client.connected()) { serial.println("connected!!!"); string info = "entry.1820200471=46"; info += "&submit=submit"; client.println(f("post docs.google.com/forms/d/1yabi7f1vieqvknn74dqhnlljqq0rjlrr1qjohrk0qhc/formresponse")); // client.println(f("http/1.1\r\n")); client.println(f("host: docs.google.com\r\n")); client.println(f("accept: */*\r\n")); client.println(f("accept-encoding: gzip, deflate\r\n")); client.println(f("user-agent: runscope/0.1\r\n")); client.println(f("content-type: application/x-www-form-urlencoded\r\n")); client.println(f("connection: close\r\n")); client.print(f("content-length: \r\n")); client.println(data.length()); client.println(); client.print(data); client.println(); serial.println("post docs.google.com/forms/d/1yabi7f1vieqvknn74dqhnlljqq0rjlrr1qjohrk0qhc/formresponse"); // serial.println("http/1.1"); serial.println("host: docs.google.com"); serial.println("accept: */*"); serial.println("accept-encoding: gzip, deflate"); serial.println("user-agent: runscope/0.1"); serial.println("content-type: application/x-www-form-urlencoded"); serial.println("connection: close"); serial.print("content-length: "); serial.println(data.length()); serial.println(); serial.print(data); serial.println(); serial.println("----------"); unsigned long lastread = millis(); while(client.connected() && (millis() - lastread < 3000)) { while (client.available()) { char c = client.read(); serial.print(c); lastread = millis(); } } serial.println("----------"); } else { serial.println("not connected"); } delay(15000l); }

and output follow:

in-loop connected!!! post docs.google.com/forms/d/1yabi7f1vieqvknn74dqhnlljqq0rjlrr1qjohrk0qhc/formresponse host: docs.google.com accept: */* accept-encoding: gzip, deflate user-agent: runscope/0.1 content-type: application/x-www-form-urlencoded connection: close content-length: 33 entry.1820200471=46&submit=submit ---------- ----------

i've tried request here , works (actually headers took there).

could help me?

i have tried various times have not found way utilize post directly. have read because google requires https communication.

to create work relay service pushinhbox.com required.

here guide: http://m.instructables.com/id/post-to-google-docs-with-arduino/

arduino can't because doesn't have programming space or ram run ssl or in usable way. here quick give-and-take it: arduino due https support

you platform intel galileo linux board runs arduino code http://arduino.cc/en/arduinocertified/intelgalileo

or raspberry pi or beaglebone black.

arduino google-docs http-post

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -