当前位置:   article > 正文

#onenet网络请求http(GET,POST)

#onenet网络请求http(GET,POST)

参考博文:

POST:

https://blog.csdn.net/qq_43350239/article/details/104361153

POST请求(用串口助手测试):

  1. POST /devices/1105985351/datapoints HTTP/1.1
  2. api-key:AdbrV5kCRsKsRCfjboYOCVcF9FY=
  3. Host:api.heclouds.com
  4. Connection:close
  5. Content-Length:58
  6. {"datastreams":[{"id":"ppm","datapoints":[{"value":10}]}]}

GET请求

 获取云平台指定设备的所有数据流的值

  1. GET /devices/1105985351/datapoints HTTP/1.1
  2. api-key:AdbrV5kCRsKsRCfjboYOCVcF9FY=
  3. Host:api.heclouds.com
  4. Connection:close
  5. //空两行

获取指定设备的指定数据流:

  1. GET /devices/1105985351/datastreams/ppm HTTP/1.1
  2. api-key:AdbrV5kCRsKsRCfjboYOCVcF9FY=
  3. Host:api.heclouds.com
  4. Connection:close

GET请求成功示例: 

  1. +IPD,376:HTTP/1.1 200 OK
  2. Date: Fri, 08 Mar 2024 11:36:30 GMT
  3. Content-Type: application/json
  4. Content-Length: 138
  5. Connection: close
  6. Access-Control-Allow-Headers: *
  7. Access-Control-Allow-Origin: *
  8. Server: Apache-Coyote/1.1
  9. Pragma: no-cache
  10. {"errno":0,"data":{"update_at":"2023-07-11 09:23:17","id":"haiba","create_time":"2023-07-10 14:29:05","current_value":238},"error":"succ"}CLOSED

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号