Action()
{
//用户登录
lr_start_transaction("login");
web_reg_save_param("sid","LB=\"detail\":\"","RB=\"}","ord=1","search=ALL",LAST);
web_add_header("Content-Type" ,"application/json");
web_custom_request("login",
"URL=http://xx.xxx.xxx.xx:8080/api/authentication/login",
"Method=POST",
"TargetFrame=",
"Resource=0",
"Referer=",
"RecContentType=application/json",
"EncType=application/json;charset=UTF-8",
"Mode=HTTP",
"Body={\"passport\":\"23333\",\"password\":\"password\"}",
LAST);
lr_message("获取到的SessionID参数为------------------------------:%s",lr_eval_string("{sid}"));
}
在编写json串时,注意保证body内容的正确性,字符串必须在\" \"之间,参数名称与参数值之间是:,参数与参数之间用逗号分隔。

浙公网安备 33010602011771号