Action()
{
web_add_header("Content-Type",
"application/json; charset=utf-8");
lr_start_transaction("etablish");
web_reg_find("Text=200",
LAST);
web_add_header("Content-Type",
"application/json; charset=utf-8");
web_add_header("Cookie",
"userAc=06;");
web_reg_save_param("res1",
"LB=msg",
"RB=",
"Search=Body",
LAST);
web_custom_request("web_custom_request",
"URL=http://ip:port/路径",
"Method=POST",
"TargetFrame=",
"Resource=0",
"Referer=",
"Body={\"参数1\":\"值\",\"参数2\":\"值2\",\"参数3\":\"值3\",\"参数4\":\"值4\",\"参数5\":\"值5\",\"参数6\":\"值6\"}",
LAST);
lr_convert_string_encoding(lr_eval_string("{res1}"),"utf-8",NULL,"msg");//将返回消息做编码转换
lr_output_message("转换后的message编码为------%s",lr_eval_string("{msg}"));
if(strcmp(lr_eval_string("{msg}"),"录单成功")==0)
return 0;
lr_end_transaction("etablish", LR_AUTO);
}
蓝色的几行是因为我写的脚本返回值存在中文时是乱码,各种设置utf-8都没有解决,所以把返回值里面的数据取出来编码转换了一下