Sending Post request with curl using nested objects Sending Post request with curl using nested objects curl curl

Sending Post request with curl using nested objects


Your curl command had extra double quotes. Please try:

curl -H 'Content-Type: application/json' -X POST -d '{"categories": { "name" :1, "url_name" : "example" }}' http://localhost:4200/add


Your curl request is not formatted correctly. Try:

curl \  -H 'Content-Type: application/json' \  -X POST \  -d '{"categories": { "name" :1, "url_name": "example" }}' \  http://localhost:4200/add