Possible to use curl upload an external json file instead of --data?

curl, json, rest

Solution

To specify the data from a file, use --data @filename. From man page of curl:

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. The contents of the file must already be URL-encoded. Multiple files can also be specified. Posting data from a file named 'foobar' would thus be done with --data @foobar.

Problem

When testing a REST POST api via curl, is it possible to send data from an external json file, instead of inline via `--data`?

Original source