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

Return to top

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
    Glad that was helpful, Vito!
    0
  • 阮惟天恩

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

    0

Please sign in to leave a comment.

Powered by Zendesk