小编Ian*_*n M的帖子

cURL 命令在 Linux 中运行,但不在 Windows 2008 中运行

我已经在 Windows 2008 Server 上安装了 cURL,并且正在尝试执行下面的命令。此命令在同一 LAN 上的 Ubuntu 机器上执行良好,但是当我在 Windows 中运行它时,出现以下错误:

curl -H "Content-Type: application/json" -X POST -d '{ "entity_id": "switch.study_cam" }' https://192.168.1.99:8123/api/services/switch/turn_off?api_password=MyAPIPassword --insecure
curl: (6) Could not resolve host: entity_id
curl: (6) Could not resolve host: switch.study_cam
curl: (3) [globbing] unmatched close brace/bracket in column 1
{"message": "Data should be valid JSON"}
Run Code Online (Sandbox Code Playgroud)

我已经使用http://www.google.com在 Windows 上测试了 cURL ,它返回了有效的 HTML,因此它似乎已正确安装。

cURL for Windows 和 Linux 之间是否存在语法差异,或者是否有其他解释为什么上述命令在 Windows 中失败?

windows-server-2008 curl

5
推荐指数
1
解决办法
2731
查看次数

标签 统计

curl ×1

windows-server-2008 ×1