curl模拟post json或post xml文件 | 您所在的位置:网站首页 › curl请求json › curl模拟post json或post xml文件 |
问题描述:
Linux用命令模拟接口,对接口判断!post文件xml/json 问题解决:cur很好地解决此问题! #curl post xml报文echo 'xxxx '| curl -X POST -H 'Content-type:text/xml' -d @- http://1.1.1.1:8081/loginregistration/register cat 1.xml | curl -X POST -H 'Content-type:text/xml' -d @- http://1.1.1.1::8081/httpInvokeServlet注解: xxxx是xml报文内容 1.xml 报文文件 @- 读取管道符内容 #curl post json 报文curl -H "Content-Type:application/json" -X POST --data 'xxxx' http://1.1.1.1:18080/ cat 1.json | curl -H "Content-Type:application/json" -X POST -d @- http://1.1.1.1:8081/httpInvokeServlet 注解: xxxx是json报文内容 1.json 报文文件 @- 读取管道符内容 |
CopyRight 2018-2019 实验室设备网 版权所有 |