我有一堆温度数据是我想要放入Google Fusion表格中的Arduino监视器。 Fusion表格需要使用OAuth作为Arduino无法处理的记录插入(我不认为),我想创建一个小应用程序Google的App Engine,它将接收来自Arduino的数据,然后这个应用程序将使用Fusion表进行身份验证并插入一条记录。每个记录将有大约65个字段。我不知道如何在Google App Engine上执行该应用,但我会分开计算。我想知道的是使用来自我的Arduino的GET请求或POST请求将数据发送到应用程序的优点和缺点。对于这种情况,是另一种更好的选择吗?Arduino POST vs GET请求
1
A
回答
0
如果您想从Arduino发送数据,您将需要使用HTTP POST请求。
两者之间的区别是,GET是用于请求数据从服务器,而POST是将数据发送到服务器。
这里是关于HTTP消息类型的链接信息:用于Arduino的代码 http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4
现在,你需要做以下发送使用GSM Shield POST请求。
//First, establish a connection to the cell tower via GSM
String PIN = "123456"; //The PIN of your SIM card
gsmAccess.begin(PIN);
//Next, connect to your service provider's GPRS network (internet access)
String GPRS_APN = "The APN of your provider";
String GPRS_LOGIN = "Your login name";
String GPRS_PASSWORD = "Your password";
gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD);
//Now you need to connect a client to your GAE web server on port 80
client.connect("ServerName", 80);
//Now send the properly-formed HTTP POST request
String message = "The message body of the request, the data you want to send";
client.print("POST ");
client.print("/yourPathToDesiredPage");
client.println(" HTTP/1.1");
client.print("Host: ");
client.println("ServerName");
client.println("Content-Type: text/plain");
client.print("Content-Length: ");
client.println(message.length());
client.println();
client.println(message);
client.endWrite();
相关问题
- 1. Http请求POST vs GET
- 2. Arduino ESP8266 AT GET请求
- 3. 将POST请求视为GET请求
- 4. Ajax POST请求变成GET请求
- 5. POST请求后的未知GET请求
- 6. 厨师HTTP请求GET/POST
- 7. Python请求POST做GET?
- 8. Android GET和POST请求
- 9. JAVA GET和POST请求
- 10. POST请求变成GET
- 11. get和post请求用VB6.0
- 12. GET请求从Arduino到Lua(ESP8266)
- 13. Guzzle POST请求php vs Ajax
- 14. Fine Uploader POST vs PUT请求
- 15. 如何在POST请求中获取GET和POST请求参数?
- 16. jquery $ .post()vs $ .get()
- 17. GET vs空POST
- 18. 使用Arduino发出http POST请求
- 19. Arduino POST ERROR不好请求行`'
- 20. 在Arduino上接收HTTP POST请求
- 21. http POST vs GET请求获取发送XML文件的文档
- 22. Arduino/Swift - BLE通信POST&GET
- 23. Receving POST请求
- 24. GET VS POST在轨
- 25. jQuery ajax()vs get()/ post()
- 26. Arduino http请求
- 27. 服务器块POST但不GET请求?
- 28. 针对WinXP的HTTP POST和GET请求
- 29. AS3 POST请求作为GET发送
- 30. Laravel,$ .ajax POST执行GET请求
如果我的回答对你有帮助,你能接受/ upvote吗?如果不是,你能否详细说明我还能如何帮助? – Adrogans