"放任"独身

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

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内容的正确性,字符串必须在\" \"之间,参数名称与参数值之间是:,参数与参数之间用逗号分隔。

 

posted on 2016-05-20 16:32  "放任"独身  阅读(856)  评论(0)    收藏  举报