esp8266连接onenet出现的问题

1、返回400
问题:发送数据格式错误
错误格式

POST /devices/618505840/datapoints HTTP/1.1\n
api-key:HEMQlrxJUs4DHm13Bk8cMM7IE=I=\n
Host:api.heclouds.com\n
Connection:close\n
Content-Length:60\n

{"datastreams":[{"id":"light","datapoints":[{"value":36}]}]}

正确格式,利用有换行功能的串口工具,一条语句输入

POST /devices/618505840/datapoints HTTP/1.1
api-key:HEMQlrxJUs4DHm13Bk8cMM7IE=I=
Host:api.heclouds.com
Connection:close
Content-Length:60

{"datastreams":[{"id":"light","datapoints":[{"value":36}]}]}

你可能感兴趣的:(物联网云,arduino)