curl -X POST -H 'Content-Type: application/json' -d '{"name":"test"}' http://localhost:3000/api

Category: Web App Development

curl -X POST -H 'Content-Type: application/json' -d '{"name":"test"}' http://localhost:3000/api

POST JSON to a local API endpoint

Posts a raw JSON payload to your local dev server's API. The -H flag sets the Content-Type header and -d supplies the request body. Use this to exercise endpoints before wiring up the frontend.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.