1

我无法读取响应之间的所有响应表单 device-mgt api。我有错误说明“连接 #0 到主机 localhost 保持不变”。你能帮我解决吗?

示例响应:

{"id":98,"dateOfEnrolment":1517461050248,"dateOfLastUpdate":1517461050248,"ownership":"BYOD","status":"ACTIVE","owner":"admin"}},{"id":99,"name":"003","type":"camera","description":"003","deviceIdentifier":"003","enrolmentInfo":{"id":99,"dateOfEnrolment":1517461108463,"dateOfLastUpdate":1517461108463,"ownership":"BYOD","status":"ACTIVE","owner":"admin"}},**{"id":100,"n* Connection #0 to host 192.168.1.18 left intact** ame":"004","type":"camera","description":"004","deviceIdentifier":"004","enrolmentInfo":{"id":100,"dateOfEnrolment":1517461156563,"dateOfLastUpdate":1517461156563,"ownership":"BYOD","status":"ACTIVE","owner":"admin"}},{"id":101,"name":"005","type":"camera","description":"005","deviceIdentifier":"005","enrolmentInfo":{"id":101,"dateOfEnrolment":1517461200437,"dateOfLastUpdate":1517461200437,"ownership":"BYOD","status":"ACTIVE","owner":"admin"}}]

4

1 回答 1

0

似乎您的 CURL 命令不正确。

解决方案:

请尝试以下命令;

curl -k -X GET 'https://192.168.1.18:8243/api/device-mgt/v1.0/devices?offset=0&limit=100' -H 'authorization: Bearer 41871ba0-3f12-3deb-a253-3911712a8187'

解释:

根据 CURL 命令;您正在尝试端口 8243。端口 8243 是 HTTPS。因此,您需要将协议指定为https://192.168.1.18:8243. 您也可以使用端口 8280 进行 HTTP 通信。

编辑: 您需要https://在 API 调用的主机名地址之前添加。请仔细参考上述 API 调用。请参阅此文档以获取偏移量和限制参数。您可以使用offsetlimit参数以分页方式查询设备。

于 2018-02-01T11:12:25.490 回答