开源项目地址:这里查看详情
更多学习资料:这里查看详情
下面是LR中Url编码转换代码:
/* 汉字进行UTF-8编码 */
lr_convert_string_encoding(lr_eval_string("{ProductName}"),LR_ENC_SYSTEM_LOCALE, LR_ENC_UTF8 , "UnicodeString");
lr_save_string (lr_eval_string("{UnicodeString}"),"urlCodeName" );
/* utf8转化为url编码 */
web_convert_param("urlCodeName", "SourceEncoding=PLAIN", "TargetEncoding=URL",LAST );
//lr_output_message("urlCodeName: %s",lr_eval_string("{urlCodeName}"));
// 添加断言字段
web_reg_find("Fail=NotFound", "Search=Body", "SaveCount=search_count", "Text=success", LAST);
// 商城商品搜索接口
web_custom_request("web_custom_request",
"URL={host}/api/product/spu/lst?"
// 请求参数
"cate_id=&order=&price_on=&price_off=&brand_id=&keyword={urlCodeName}&page=1&limit=10",
"Method=GET",
"TargetFrame=",
"Resource=1",
"Referer=",
"Mode=HTTP",
"EncType=application/json",
"Body=",
LAST);
if(atoi(lr_eval_string("{search_count}"))>0){
lr_output_message("商品搜索成功!");
}else{
lr_output_message("商品搜索失败!");
}