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]

posted @ 2020-02-24 12:01  hezhixiong  阅读(60)  评论(0编辑  收藏