cURL POST JSON Example

Use this example to separate API behavior from frontend, SDK or framework code.

cURL command
curl -sS -X POST 'https://api.example.com/v1/items' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  --data '{"name":"demo","enabled":true}'

How to use this example

  1. Replace the URL and token placeholder locally.
  2. Validate JSON before sending the request.
  3. Add -i when you need response headers.

Notes

  • Never commit real bearer tokens in docs.
  • Use curl -v only when you need low-level TLS or connection details.

Related tools and fixes

Last updated: May 18, 2026