curl post file json

JavaScript
curl -d '{"option": "value", "something": "anothervalue"}' -H "Content-Type: application/json" -X POST https://flaviocopes.com/
Source

Also in JavaScript: