我正在尝试使用一些 json 数据在 Windows 控制台上发出 POST 请求,但出现此错误:
curl: (6) Could not resolve host: John,
curl: (6) Could not resolve host: lName
curl: (6) Could not resolve host: Doe,
curl: (6) Could not resolve host: phone
curl: (6) Could not resolve host: 0123456789,
curl: (6) Could not resolve host: passwd
curl: (6) Could not resolve host: myPassword,
curl: (6) Could not resolve host: tosAgm
curl: (3) [globbing] unmatched close brace/bracket in column 5
{}
请求如下所示:
curl -d '{"fName": "John", "lName": "Doe", "phone": "0123456789", "passwd": "myPassword", "tosAgm": "true"}' -H "Content-Type: application/json" -X POST http://localhost:3000/users
在做了一些研究之后,我发现请求是正确的,那么为什么我会收到这个错误呢?如何解决?
我认为你需要转义双引号
curl -d '{\"fName\": \"John\", ...
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句