use pipe for curl data

后端 未结 8 462
盖世英雄少女心
盖世英雄少女心 2020-12-23 13:26

I\'m trying to pass the cat output to curl:

$ cat file | curl --data \'{\"title\":\"mytitle\",\"input\":\"-\"}\' http://api

Bu

8条回答
  •  误落风尘
    2020-12-23 13:59

    You can use the magical stdin file /dev/stdin

    cat data.json | curl -H "Content-Type: application/json" -X POST -d "$(

提交回复
热议问题