First, POST + JSON format parameters
Cases:
Web_custom_request ("Create",
"Url=http://xxx.xxx.x.xx:1600/ditui/agentshop",
"Method=post",
"Resource=0",
"Reccontenttype=application/json",
"Referer=",
"Mode=html",
"Enctype=application/json;charset=utf-8",
"Body={\" agentid\ ": 31,"
"\" contactname\ ": \" test\ ","
"\" contactphone\ ": \" 18259001421\ ","
"\" fullname\ ": \" Lai Everyone home Squatting branch 1\ ","
"\" shortname\ ": \" le3jxd\ ","
"\" vipemail\ ": \" [Email protected]\ ","
"\" shoptype\ ": \" 1\ ","
"\" address\ ": \" Shenzhen, Bao ' An district, Guangdong Province, overseas Chinese village 29-b 204\ ","
"\" businessscope\ ": \" 3\ ","
"\" businesslicensecode\ ": \" 140100200567176\ ","
"\" businesslicenseurl\ ": \" 2016/01/04/fcd1bde5-f64f-4aa6-82c9-82b65cd7ccfd.jpg\ ","
"\" province\ ": \" 620000\ ","
"\" city\ ": \" 620200\ ","
"\" area\ ": \" 620201\ ","
"\" headaddress\ ": \" Shenzhen Baoan District, Guangdong province ","
"\" legalname\ ": \" Shin \ ","
"\" idcard\ ": \" 451202198403264276\ ","
"\" idcardstartdate\ ": \" 2010-10-06\ ","
"\" idcardenddate\ ": \" 2020-10-06\ ","
"\" idcardfronturl\ ": \" 2016/01/06/d342b28d-c62d-416e-b947-47e47ab95d08.jpg\ ","
"\" idcardbackurl\ ": \" 2016/01/06/f03e967a-168c-4ba6-ba99-04a3c6790bf6.jpg\ ","
"\" Phonenumber\ ": \" 18259001421\ "}",
last);
Operation Result:
Description: Body notation
1) The parameters are written in one line
"Body={" arg1 ": int_value1," arg2 ":" Str_value2 ",...," ArgN ":" Valuen "}",
2) parameter not all on the same line
"Body={" arg1 ": value1,"
"Arg2": "Str_value2", "
"Arg3": "Str_value3", "
......
"" ArgN ":" Valuen "}",
Second, POST + non-JSON format parameters
Cases:
Web_custom_request ("Login",
"Url=http://127.0.0.1:1080/webtours/login.pl",
"Method=post",
"Resource=0",
"Reccontenttype=",
"Referer=http://127.0.0.1:1080/webtours/nav.pl?in=home",
"Mode=html",
"Enctype=application/x-www-form-urlencoded",
"Body=usersession=117812.897691373zazaaaapqcfdzdzapaafff&username=jo
Jo&password=bean&login.x=0&login.y=0&jsformsubmit=off ",
last);
Operation Result:
Third, GET
Cases:
Web_custom_request ("View_active_page",
"Url=http://xx.xxxxx.xxxx.cn/index.php?xx=/xxxx/lucky/christport/sav
E_user_info/id/726/token/84222366b2592714538e50dc69398ad7/open_id/ous64unjabudzu00000751vyh9k/nickname/test_ User/headimgurl/testurl ",
"Method=get",
"Resource=0",
"Reccontenttype=application/json",
"Referer=",
"Mode=html",
"Enctype=application/x-www-form-urlencoded;charset=utf-8",
"Body=",
last);
a complete example
Join_active ()
{
Web_reg_save_param ("Result",
"Lb=result\": ",
"Rb=,\" ",
"Notfound=error",
"Search=all",
last);
Lr_rendezvous ("join_active");
Participation in Sweepstakes
Lr_start_transaction ("join_active");
Web_custom_request ("Choujiang",
"url=http://xx.xxx.xxxx/index.php?s=/addon/lucky/christport/lucky/id/726/open_id/{open_id}/token/ 84222366b2592714538e50dc69398ad7 ",
"Method=get",
"Resource=0",
"Reccontenttype=application/json",
"Referer=",
"Mode=html",
"Enctype=application/x-www-form-urlencoded;charset=utf-8",
"Body=",
last);
if (strcmp ("102", lr_eval_string ("{result}") ==0 | | strcmp ("103", lr_eval_string ("{result}")) ==0)
{
Lr_end_transaction ("Join_active", Lr_pass);
}else{
Lr_end_transaction ("Join_active", Lr_fail);
}
return 0;
}
Loadrunder script--web_custom_request doing interface testing