因為登陸服務升級,密碼策略變更,以前的測試腳本中的用戶密碼已經不能登陸,試圖通過API直接更改密碼,一種是直接update,一種是change,使用curl的時候均未成功。
最后索性重新用curl命令創建新的用戶,一番摸索下來,注冊用戶僅支持私有端口。剩下的問題就是如何使用curl來postxml 文件。
經過一番查找,終於找到了curl使用post的命令:
- echo '<?xml version …>'|curl -X POST -H 'Content-type:text/xml' -d @- http://10.206.30.32:8081/loginregistration/register
echo '<?xml version …>'|curl -X POST -H 'Content-type:text/xml' -d @- http://10.206.30.32:8081/loginregistration/register
其中<?xml version …>就是要post的xml 文件,8081是私有端口。
例子:
Request:
- echo '<?xml version="1.0" encoding="utf-8" ?><user>......</user>'|curl -X POST -H 'Content-type:text/xml' -d @- http://10.206.30.32:8081/loginregistration/register
echo '<?xml version="1.0" encoding="utf-8" ?><user>......</user>'|curl -X POST -H 'Content-type:text/xml' -d @- http://10.206.30.32:8081/loginregistration/register
Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><user>......</user>

