curl -d @payload.json http://localhost:3000/api

Category: Web App Development

curl -d @payload.json http://localhost:3000/api

Read the POST body from a JSON file

Sends the contents of payload.json as the request body. The @ prefix makes curl read data from a file instead of the command line, keeping long payloads out of shell history. Add the Content-Type header to match what the server expects.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.