gpt4 book ai didi

azure - 如何在您的curl请求中指示您需要在Azure IoT中心使用的路由?

转载 作者:行者123 更新时间:2023-12-03 04:43:43 25 4
gpt4 key购买 nike

我正在阅读有关 Azure IoT 中心路由的多个文档:

但是当您在有关“路由查询”的部分中添加:level="storage"并创建路由时,如何在curl请求中指示您需要使用的路由。

目前,我使用curl的请求是:

  curl --request POST \
--url "https://${IOT_HUB}.azure-devices.net/devices/${DEVICE}/messages/events?api-version=2018-06-30" \
--header "Accept: application/json" \
--header "Content-Type: application/json;charset=utf-8" \
--header "Authorization: ${SAS_TOKEN}" \
--data "{ \"field1\" : \"value\", \"field2\" : \"value\" }" \
--verbose

如何添加路由level="storage"的信息?

提前非常感谢

胡安·安东尼奥

最佳答案

微软文档中的路由示例都是使用SDK的示例,您需要在消息的appProperties部分添加一项。但如果您需要使用 HTTP 端点,则可以通过包含前缀为“iothub-app-”的 header 来添加 appProperties。因此,您需要在curl命令中添加的 header 是

--header "iothub-app-level: storage" \

查找文档 here

编辑:我看到罗曼比我快了半分钟。

关于azure - 如何在您的curl请求中指示您需要在Azure IoT中心使用的路由?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61267275/

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