gpt4 book ai didi

rest - 云到设备 Azure IoT REST API

转载 作者:行者123 更新时间:2023-12-02 09:20:49 24 4
gpt4 key购买 nike

我探索了如何使用 Azure REST API 将数据从设备发送到云。它运行无缝,没有任何问题。我没有找到有关使用“Azure IoT Hub REST API”向 Arduino 板发送云到设备消息的好文章。有人可以就此提出建议

最佳答案

您还可以像 azure 门户那样发送请求。来自 AZ Portal 的所有 C2D 均通过此端点发送 https://main.iothub.ext.azure.com/api/Service/SendMessage/有效负载是一个如下所示的 json:

{
"hostName": "iothub-hostname",
"owner": "twinUpdate",
"key": "key for the iothub",
"deviceID": "your device on that hub",
"body": "{\"test\": \"This is a test over postman\"}",
"properties": "[]"
}

请记住,您需要添加具有有效承载 token 的授权 header 。您可以在登录 AZ Portal 时获取此信息。

关于rest - 云到设备 Azure IoT REST API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42764112/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com