curl
Posted hezhixiong
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了curl相关的知识,希望对你有一定的参考价值。
1. curl post json
request:curl http://127.0.0.1:9098/hello -X POST -H ‘Content-Type: application/json‘ -d ‘{
"username": "zhang_san",
"password": "md5(zhang_san)"
}‘
response:{"code":200,"msg":"success"}
2. curl post json and get response of http_code
request:curl http://127.0.0.1:9098/hello -X POST -H ‘Content-Type: application/json‘ -d ‘{
"username": "zhang_san",
"password": "md5(zhang_san)"
}‘ -w ‘ [http_code: %{http_code}]‘
response:{"code":200,"msg":"success"} [http_code: 200]
以上是关于curl的主要内容,如果未能解决你的问题,请参考以下文章