如何用Curl 来post xml 数据
2012-05-05 10:05
302 查看
因为登陆服务升级,密码策略变更,以前的测试脚本中的用户密码已经不能登陆,试图通过API直接更改密码,一种是直接update,一种是change,使用curl的时候均未成功。
最后索性重新用curl命令创建新的用户,一番摸索下来,注册用户仅支持私有端口。剩下的问题就是如何使用curl来postxml 文件。
经过一番查找,终于找到了curl使用post的命令:
最后索性重新用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[/code] 其中<?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[/code] Response:<?xml version="1.0" encoding="UTF-8" standalone="yes"?><user>......</user>
相关文章推荐
- linux如何用curl 来post xml 数据
- 如何用Curl 来post xml 数据
- Web前端 测试数据接口url,如何post一个XML字符串,点击保存就可以保存到数据库
- PHP如何以post形式发送xml数据
- cURL模拟POST方法提交XML数据并解析
- PHP中CURL使用POST提交XML数据
- CURL 如何同时进行POST请求并添加请求字符串 进行发送数据并且添加参数
- PHP-PHP如何以post形式发送xml数据
- Android中如何解析XML数据
- PHP的CURL方法curl_setopt()函数案例介绍(抓取网页,POST数据)
- PHP函数分享之curl方式取得数据、模拟登陆、POST数据
- php 利用curl get post数据
- 如何对SQL Server中的XML数据进行insert、update、delete
- 四种常见的 POST 提交数据方式(application/x-www-form-urlencoded,multipart/form-data,application/json,text/xml)
- PHP之文件操作,http请求数据格式,模拟get和post,CURL模拟请求的使用
- 关于PHP Curl POST 数据丢失的问题
- AFNetworking 如何POST一个JSON数据到服务器
- 安卓如何生成xml文件数据
- curl:get,post 以及SoapClien访问webservice数据
- curl附带cookie post数据提交