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