【发布时间】:2020-06-07 22:08:38
【问题描述】:
我一直在阅读有关 Cisco ACI Automation with cURL here 并尝试遵循相同的步骤。
很遗憾,该代码不适用于 cURL。我收到以下错误。
C:\>curl -X POST -k https://x.x.x.x/api/aaaLogin.json -d '{"aaaUser":{"attributes":{"name":"user007","pwd":"password007"}}}'
{"totalCount":"1","imdata":[{"error":{"attributes":{"code":"400","text":"JSON parsing failed - incomplete attribute value at line: 1"}}}]}
C:\>
但是,当我使用 Postman 测试相同的代码时,它的工作就像一个魅力。 curl 命令出了什么问题?
注意:我没有在此示例中输入 -c cookie.txt,因为即使它存在,我也会遇到相同的错误。
期望的输出
获得正确的 HTTP 200 响应,而不是 400 Bad Request ..
【问题讨论】:
-
你没有错过
-c cookie.txt部分吗? -
即使使用
-c cookie.txt仍然出现同样的错误