API error: curl: (3) URL using bad/illegal format or missing URL



image avatar

Dwight Bussman

Zendesk Customer Care

Edited Mar 27, 2025


0

3

3 comments

      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


      Sign in to leave a comment.