问题特征
我尝试通过终端使用 cURL 命令,如文档中所述:测试您的 cURL 安装。但是,我收到了以下错误消息。
curl: (3) URL using bad/illegal format or missing URL
解决方案
错误 curl:3) URL using bad/illegal format or missing URL 可能是由密码的字符问题引起的。诸如 @
或 &
或其他符号之类的字符可能会在命令行上产生问题。
要解决此问题,请在您的 URL 两边添加双引号。
"username@domain.net"
如果这样不能解决问题,请不要使用密码,而是生成新的 API 密钥。
3 条评论
阮惟天恩
Thanks everyone, fix my error when building my first application also
0
Dave Dyson
0
Vito Perrotta
Perfect. Fixed by adding double quotes around my URL. Original form was :
curl -X POST localhost:8080/employees -H 'Content-type:application/json' -d '{"name": "Samwise Gamgee", "role": "gardener"}'
Fixed form :
curl -X POST localhost:8080/employees -H "Content-type:application/json" -d "{\"name\": \"Samwise Gamgee\", \"role\": \"gardener\"}"
Many thanks.
Vito
1
登录以发表评论。