美文网首页爬虫工具
使用 curl命令 模拟json格式的POST请求

使用 curl命令 模拟json格式的POST请求

作者: HowieDev | 来源:发表于2018-09-28 15:47 被阅读414次

curl 命令如下:

curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"phone": "18000011005","password": "xxxxx", "status":40,"order_no":"1998708","config":{"loading":true},"data": "123", "appVersion": "1.2.3","CHEN_ZHE_TEST_ONE_TWO_THREE": 1}'  http://192.168.57.80/mjyx-mall-gateway2/web/index.php/auth/login

设置POST Header

-H "Accept: application/json" -H "Content-type: application/json" -X POST -d 

请求参数 parames

'{"phone": "18000011005","password": "xxxxx", "status":4,"order_no":"1998708","config":{"loading":true},"data": "123", "appVersion": "1.2.3","CHEN_ZHE_TEST_ONE_TWO_THREE": 1}' 

请求路径 URL

http://192.168.57.80/gateway/login

使用curl 命令拼接这三个参数,就可以打印出请求结果。

相关文章

网友评论

    本文标题:使用 curl命令 模拟json格式的POST请求

    本文链接:https://www.haomeiwen.com/subject/svjpoftx.html