Issue symptoms
I tried to use a cURL command through the terminal as explained in the documentation: Testing your cURL installation. However, I received the below error message.
curl: (3) URL using bad/illegal format or missing URL
Resolution
The error curl: (3) URL using bad/illegal format or missing URL could be caused by a character issue with the passwords. Characters such as @ or & or other symbols may be problematic on the command line.
To fix this issue, add double quotes around your URL.
"username@domain.net"
If that doesn't fix the issue, instead of using a password, generate a new API token.
3 comments
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
Dave Dyson
0
阮惟天恩
Thanks everyone, fix my error when building my first application also
0