在Azure上处理POST请求 [英] Handling POST request on Azure

查看:131
本文介绍了在Azure上处理POST请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!


我正在寻找这一段时间,但我找不到任何答案...... 我必须从我的ESP8266设备发送POST HTTP请求以发送JSON,然后将来自此JSON的数据存储到数据库。 (数据将是由GPS记录的[x,y,时间]三元组,并从位于我车内的SD卡获取
- 所谓的"跟踪器";))我知道,嗯......至少我希望我知道并且我说得对,有两种方法可以做到:


1)在某处制作一个C#服务器应用程序(可能是我家中笔记本电脑上的b-ground应用程序)会听到来自ESP的任何请求(一旦汽车靠近家中 - 捕获家庭的网络信号),只需使用Azure数据库提供的旧的,可爱的connectionString
从JSON保存数据。但是请...当我的电脑打开时间太长时我的电脑太热了:O


2)ESP会(再次:当它接收到家庭网络信号的时候)$
直接向Azure服务发送POST请求,然后......以某种方式......将处理此HTTP POST请求,来自JSON的数据将是
放入我的数据库。 (我怎么能得到我在ESP端函数中调用的URL,如:http.begin(" http://192.168.8.134/sthhere" -
我想我需要一些一种身份验证,否则每个人都可以将垃圾数据扔进我的数据库......)


总结:我要求选项2的可能性。这甚至可能吗?如果是的话,请给我一些提示,告诉我如何做到这一点。


提前谢谢大家!

解决方案

以下教程基于ESP8266设备,将引导您完成在无线网络上设置电路板的过程,并可作为解决方案的示例:  Connect
Adafruit羽毛HUZZAH ESP8266到云中的Azure IoT Hub
 


你需要的是一个具有蜂窝调制解调器的设备可以保持互联网连接,并将遥测数据实时发送到IoT Hub。


请查看以下
物联网设备目录


我希望这会有所帮助。如果您还有其他问题,请告诉我们。


Hi!

I was searching for this for a while, but I coudn't find any answers...  I have to send a POST HTTP request from my ESP8266 device to send a JSON and than store data from this JSON to database. (Data will be [x,y,time] triples recorded by GPS and taken from SD card located in my car - so called "tracker" ;) )I know, well... at least I HOPE I know and that I get this right, that there are 2 ways to do it:

1) Make a C# server app somewhere (probably as b-ground application on laptop in my home) that would listen to any requests from ESP (as soon as car gets close to home - catches home's network signal) and just save data from JSON using old, lovely connectionString provided by Azure Database. But please...my PC gets too hot when it's turned on for too long :O

2) ESP would (again: as soon as it catches signal of home's network of course) send POST request directly to Azure service and there...somehow...this HTTP POST request would be handled and data from JSON would be put into my DataBase. (How could I get the URL that I would call in ESP-side function, like: http.begin("http://192.168.8.134/sthhere" - I guess I would need some sort of authentication, otherwise everybody could just throw trash data into my DB...)

In summary: I am asking for posibility of option 2). Is this even possible? If it is, please give me some hints, advices on how I could do this.

Thank You all in advance!

解决方案

The following tutorial is based upon the ESP8266 device and will walk you through the process of setting up the board on a wireless network, and can be used as an example to base your solution upon: Connect Adafruit Feather HUZZAH ESP8266 to Azure IoT Hub in the cloud 

What you need is a device with a cellular modem to stay internet connected and send the telemetry data to IoT Hub in real-time.

Please take a look at the following IoT Device Catalog.

I hope this helps. Please let us know if you have additional questions.


这篇关于在Azure上处理POST请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆