I\'m trying to pass the cat
output to curl:
$ cat file | curl --data \'{\"title\":\"mytitle\",\"input\":\"-\"}\' http://api
Bu
Curl documentation for -d option
If you start the data with the letter @, the rest should be a file name to read the data from, or - if you want curl to read the data from stdin. Multiple files can also be specified. Posting data from a file named 'foobar' would thus be done with -d, --data @foobar. When --data is told to read from a file like that, carriage returns and newlines will be stripped out. If you don't want the @ character to have a special interpretation use --data-raw instead.
Depending of your HTTP endpoint, server configuration, you should be good by using this format:
curl -d @data.json http://api
This should also work
curl -H "Content-Type: application/json" -d @data.json http://api
Using -d forces curl to implicitly use POST for the request.