Erro de API: curl: (3) URL com formato inválido/ilegal ou URL ausente



image avatar

Dwight Bussman

Zendesk Customer Care

Editado 02 de abr. de 2025


0

0

3 comentários

Thanks everyone, fix my error when building my first application also

0


Glad that was helpful, Vito!

0


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


Entrar para comentar.