API 错误:curl:(3) 个 URL 使用错误/非法格式或 URL 缺失



image avatar

Dwight Bussman

Zendesk Customer Care

已于 2025年4月03日 编辑


0

0

3 条评论

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


登录以发表评论。