curl basic

curl --request POST --basic --user uername:pwd -H @header.json --data @body.json

basic auth

--basic

从文件中读取header, body

curl --request POST --basic --user test:test -H @header.txt --data @bodyf.json url

header.txt

Authorization: Basic dGVzdDp0ZXN0
Content-Type: application/json
Accept: */*
Accept-Encoding: gzip, deflate, br
Connection: keep-alive

bodyf.json

your json

上传文件

curl --request POST  -H @cheader.txt --form pushfile=@"path/to/data.zip" 127.0.0.1:3000/uploadfile

cheader.txt

Content-Type: multipart/form-data
Accept: */*
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
posted @ 2020-09-22 11:37  fndefbwefsowpvqfx  阅读(459)  评论(0编辑  收藏  举报