脚本:http接口调用

上一篇 / 下一篇  2017-04-19 10:06:16 / 个人分类:性能测试

关于:对外提供的HTTP接口,http方式的post请求,json方式提交,实例代码编写:
Action()
{
 web_reg_save_param("response",
        "LB=",
        "RB=",
        "Search=Body",
        LAST);
lr_start_transaction("FeatureComp");
 web_custom_request("web_custom_request",
    //"URL=http://10.2.34.70:6000/face/faceCompare.do",
    "URL=http://10.2.34.22:8080/rvsp-facen/faceRepo/icompareByIdTypeNo",
                "Body={\"base64Img\":\"{NewParam}\",\"idType\":\"1\",\"idNo\":\"430381198101143025\",\"runningNo\":\"11\"}",
    "Method=POST",
    "Resource=0",
    "RecContentType=application/json",
    "Referer=",
    "Mode=HTML",
    "EncType=application/json",
    LAST);
  lr_end_transaction("FeatureComp", LR_AUTO);
 lr_convert_string_encoding(lr_eval_string ("{response}"),LR_ENC_UTF8 ,LR_ENC_SYSTEM_LOCALE, "response_ok");
  lr_output_message("RESPONSE = %s",lr_eval_string("{response_ok}"));
 return 0;
}

TAG: 接口

 

评分:0

我来说两句

Open Toolbar