curl命令發(fā)送post請求 如何用Curl來post xml數(shù)據(jù)?
如何用Curl來post xml數(shù)據(jù)?經(jīng)過一番搜索,我們終于找到了curl使用post的命令:echo“| curl-x post-H”content-類型:text/xml“-d@-http://1
如何用Curl來post xml數(shù)據(jù)?
經(jīng)過一番搜索,我們終于找到了curl使用post的命令:
echo“| curl-x post-H”content-類型:text/xml“-d@-http://10.206.30.32:8081/loginregistration/Register
其中是要發(fā)布的XML文件,8081是專用端口。
示例:
請求:
echo “”| curl-x post-H “內(nèi)容-類型:text/xml“-d@-http://10.206.30.32:8081/loginregistration/Register
響應(yīng):
通過做出相關(guān)判斷,可以判斷業(yè)務(wù)是否正常
curl對post數(shù)據(jù)大小有限制么?
PHP curl庫的默認(rèn)長度為1024字節(jié),不等待數(shù)據(jù)返回。