Action()
{
//首先调用web_reg_find()这个注册函数,我们接口的正常返回结果都是<Code>0</Code>
web_reg_find("Search=Body", //定义查找范围
"SaveCount=result", //定义查找计数变量名称
"Text=\"ret_code\":\"0000\"", //定义查找内容
LAST);
web_custom_request("web_custom_request",
"URL=http://xxxx/xxxx/xxxx.json",
"Method=POST",
"Resource=0",
"RecContentType=application/json",
"Referer=",
"Mode=HTTP",
"EncType=application/json",
"Body={\"body\":{\"user_no\":\"123\",\"user_password\":\"123456\"}}",
LAST);
//刚才的web_reg_find()注册函数派上用处,可以对结果进行统计
if (atoi(lr_eval_string("{result}")) > 0) //判断如果<Code>0</Code>
//字符串出现次数大于0
lr_output_message("request success"); //在日志中输出Log on successful
else
//如果出现次数小于等于
lr_error_message("request failed"); //在日志中输出Log on failed
return 0;
}
{
//首先调用web_reg_find()这个注册函数,我们接口的正常返回结果都是<Code>0</Code>
web_reg_find("Search=Body", //定义查找范围
"SaveCount=result", //定义查找计数变量名称
"Text=\"ret_code\":\"0000\"", //定义查找内容
LAST);
web_custom_request("web_custom_request",
"URL=http://xxxx/xxxx/xxxx.json",
"Method=POST",
"Resource=0",
"RecContentType=application/json",
"Referer=",
"Mode=HTTP",
"EncType=application/json",
"Body={\"body\":{\"user_no\":\"123\",\"user_password\":\"123456\"}}",
LAST);
//刚才的web_reg_find()注册函数派上用处,可以对结果进行统计
if (atoi(lr_eval_string("{result}")) > 0) //判断如果<Code>0</Code>
//字符串出现次数大于0
lr_output_message("request success"); //在日志中输出Log on successful
else
//如果出现次数小于等于
lr_error_message("request failed"); //在日志中输出Log on failed
return 0;
}