首页 > 技术文章 > Loadrunner:LR提交JSON格式的POST请求

channy14 2016-05-30 09:14 原文

场景:

影视分发:影院客户端向管理平台发起取任务的操作,取任务接口getDispatchTask,为JSON格式的POST请求

 

 1 Action()
 2 {
 3      web_custom_request("getdispatch",
 4         "URL=http://rct.chinanetcenter.com:60009/rctItfAgent/dispatch/getDispatchTask",     //请求的目的地址
 5         "Method=POST",      //POST请求
 6         "Resource=0",
 7         "Referer=",
 8         "mode=HTTP",
 9         "EncType=application/json",  //返回JSON格式
10         "Body={\"hcode\":\"RCT_DISPATCH1464498178829230207\"}",         //提交的JSON请求
11     LAST);
12 return 0;
13 }

 

推荐阅读