curl命令发送post请求 如何用Curl来post xml数据?

如何用Curl来post xml数据?经过一番搜索,我们终于找到了curl使用post的命令:echo“| curl-x post-H”content-类型:text/xml“-d@-http://1

如何用Curl来post xml数据?

经过一番搜索,我们终于找到了curl使用post的命令:

echo“| curl-x post-H”content-类型:text/xml“-d@-http://10.206.30.32:8081/loginregistration/Register

其中是要发布的XML文件,8081是专用端口。

示例:

请求:

echo “”| curl-x post-H “内容-类型:text/xml“-d@-http://10.206.30.32:8081/loginregistration/Register

响应:

通过做出相关判断,可以判断业务是否正常

curl对post数据大小有限制么?

PHP curl库的默认长度为1024字节,不等待数据返回。