Action()
{
int HttpRetCode; //定义一个变量,用于接收HTTP返回的状态码
web_add_header("Session-Id", "a3ffa6fd-a767-4eec-bd2f-7bc160a71e41"); //请求头
web_add_header("Content-Type", "application/json"); //请求头
lr_start_transaction("更改昵称和描述");
//接口
web_custom_request("更改昵称和描述",
"URL= http://192.168.1.191:8080/users/change/info?nickname=nicheng&description=miaoshu",
//"URL= http://192.168.1.191:8080/users/change/info",
"Method=PUT",
"TargetFrame=Main",
"Resource=0",
"RecContentType=text/html",
"Mode=http",
//ITEMDATA,
//传参
//"Name=nickname", "Value=", ENDITEM,
//"Name=description", "Value=", ENDITEM,
//传参
LAST );
HttpRetCode=web_get_int_property(HTTP_INFO_RETURN_CODE); //获取返回的状态码
if(HttpRetCode==200) //如果状态码返回200,则是成功的
{ lr_output_message("成功!");
lr_end_transaction("更改昵称和描述", LR_PASS);
}
else
{ lr_output_message("失败!");
lr_end_transaction("更改昵称和描述", LR_FAIL);
}
return 0;
}