In curl
command, there is --data
option, which substitutes the file contents when the option value is prefixed by @
symbol like,
curl -X POST --data @abc.json hostaddr.com
abc.json
file contents are sent as the post request's body. This option is handy, if the post body is lengthy/multi-lined.
How can i do this in zshell
or may be in, any linux shell? Is there a glob pattern
/prefix operator
, that will treat the following string as the file path and replace the string with the file contents?