curl -X POST https://api.example.com/posts \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer TOKEN' \
-d '{"title": "Hello", "draft": true}'
Newer curl (7.82+) has --json, which sets both the content type and the accept header:
curl --json '{"title": "Hello"}' https://api.example.com/posts
Read the body from a file with -d @post.json, and add -i to see the response headers, or -s -o /dev/null -w '%{http_code}\n' to see only the status code.