怎样用LoadRunner模拟如下请求
来源:互联网 发布:360数据恢复在哪里 编辑:程序博客网 时间:2024/05/19 01:11
转自【http://www.7dtest.com/bbs/viewthread.php?tid=855&extra=page%3D1】
期望模拟的请求:
代码:
POST /yourURL/ HTTP/1.1
Content-Type: text/xml
Content-Length: 443
Cache-Control: no-cache
Pragma: no-cache
Accept: text/html
Connection: keep-alive
<?xml version="1.0" encoding="UTF-8"?><content>something</content>
尝试:使用web_submit_data,参数非要指定Name和Value。想仅Post一个XmlString过去而已:
代码:
web_submit_data("PostXmlRpc",
"Action=http://testServier/yourURL/",
"Method=POST",
"EncType=multipart/form-data",
"RecContentType=text/xml",
ITEMDATA,
"Name=<?xml version",
"Value=/"1.0/" encoding=/"UTF-8/"?><content>something</content>",
ENDITEM,
LAST);
但结果是:
引用:
引用:
(RelFrameId=1, Internal ID=1)
-----------------------------7d025e2b16b064e/r/n
Content-Disposition: form-data; name="<?xml version"/r/n
/r/n
"1.0" encoding="UTF-8"?><methodCall xmlns:ex="http://ws.apache.org/xmlrpc/namespaces/exten
sions"><methodName>auth.getFrob</methodName><params><param><value><struct><member><name>gu
id</name><value>e6cae838171c4088945e89766751bdcd</value></member><member><name>c</name><va
lue>4B0D097E</value></member><member><name>appkey</name><value>53C927D1A198A7119AA0F337748
4FE81</value></member></struct></value></param></params></methodCall>/r/n
-----------------------------7d025e2b16b064e--/r/n
红色是web_submit_data自动生成而不需要的部分。
-------------------------------------------------------------------
解决方法:
其实很简单的:代码:
web_add_header("User–Agent", "Apache Agent Xml user");
web_custom_request("XmlRpc", "Method=POST",
"Body=<?xml version=Value=/"1.0/" encoding=/"UTF-8/"?><content>something</content>",
LAST);
web_custom_request直接写消息正文。
所以就叫自定义请求了
- 怎样用LoadRunner模拟如下请求
- LoadRunner模拟Json请求
- Loadrunner模拟Json请求
- LoadRunner模拟Json请求
- LoadRunner模拟接口请求
- Loadrunner模拟JSON接口请求进行测试
- Loadrunner模拟JSON接口请求进行测试
- Loadrunner模拟JSON接口请求进行测试
- Loadrunner模拟JSON接口请求进行测试
- Loadrunner模拟JSON接口请求进行测试
- Loadrunner模拟JSON接口请求进行测试
- Loadrunner模拟JSON接口请求进行测试
- LoadRunner模拟客户端发送JSON格式的请求
- Loadrunner模拟数据请求(举个栗子)
- LoadRunner测试webservice接口-方法二(模拟http请求)
- LoadRunner测试webservice接口-方法二(模拟http请求)
- Loadrunner 11 测试API java Vuser 模拟Post,Get 请求实例
- LoadRunner中的带宽模拟
- 为C++编程者开发的Objective-C(一)
- VS2005命令行问题-manifest
- 教你建个既无法进入又删除不了的文件夹
- Solaris下用root用户ssh远程的方法
- 组播、IGMP、IGMP Snooping
- 怎样用LoadRunner模拟如下请求
- 80后的一代
- 为C++编程者开发的Objective-C(二)
- 利用MPC创建VC工程
- C++ 发手机短信(很易很简单)
- 我的解法:五间房子中谁养鱼的问题
- Java环境变量配置
- ubuntu下,如何解压rar 格式文件
- 学会用core dump调试程序错误