|
服务器:nginx
测试需要模拟REST client向服务器发送Post请求,消息如下所示
POST /1.0.0.0/EnterAccounts/scy/SubAccounts/Create?sig=54ce457b7183895ce18f09cb383c698dHTTP/1.1
Content-Type: application/xml;charset=utf-8
Accept: application/xml
Authorization: MTAwMDoyMDEzMTExMzE1NDI1Nw==
Content-Length: 111
Host: 192.168.27.108:7777
Connection: Keep-Alive
<?xml version='1.0' encoding='utf-8'?>
<Create>
<appId>5ebdce4f87104b11b5ee9bf88ec53d4a</appId>
<accountSid>1000</accountSid>
</Create>
初学LR,摸索写了个脚本
web_add_header("Authorization", "MTAwMDoyMDEzMTExMzE1NDI1Nw==");
web_custom_request("web_custom_request",
"URL=http://192.168.27.108:7777/1.0.0.0/EnterAccounts/scy/SubAccounts/Create?sig=54ce457b7183895ce18f09cb383c698d",
"Method=POST",
"Resource=0",
"RecContentType=application/xml",
"Referer=",
"Mode=HTTP",
"EncType=Content-Type: application/xml;charset=utf-8",
"Body=<?xml version='1.0' encoding='utf-8'?>/r/n"
"<Create>/r/n"
"<appId>5ebdce4f87104b11b5ee9bf88ec53d4a</appId>/r/n"
"<accountSid>1000</accountSid>/r/n"
"</Create>/r/n",
LAST);
请问各位大侠,如何实现?谢谢! |
|