The curl
manpage isn't super clear on this, but to read from stdin
you need to prepend the dash with a @
.
json_producer | curl -d @- -H 'Content-Type: application/json' http://example.com/json_consumer
The curl
manpage isn't super clear on this, but to read from stdin
you need to prepend the dash with a @
.
json_producer | curl -d @- -H 'Content-Type: application/json' http://example.com/json_consumer