爬虫工具

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

2018-09-28  本文已影响414人  HowieDev

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 命令拼接这三个参数,就可以打印出请求结果。

上一篇下一篇

猜你喜欢

热点阅读