curl 笔记

curl 用法详情

Posted by pigTom on November 13, 2018

curl post 请求

curl url -X POST - H “Content-Type:application/json” -d ‘{“key”:value,”key”:“value”}’
例如: curl http://http://retailop.test.yijiupidev.com/templates/dictionary/listDict POST -H “Content-Type:application/json” -d {“pageIndex”:1,”title”:”redPacket”}

curl get 请求

curl url [-v]
例如: curl localhost:9999/api/helloworld -v

curl 上传文件

curl localhost:8000/xxx/getfile -F “file=@/home/pigTomg/img/01.png” -H “token:xxx” -v -F后面的参数为 file=@path