一、web_get_int_property函数
1、函数用途
记录http响应的信息
2、函数属性
1)HTTP_INFO_RETURN_CODE: 返回http代码
2)HTTP_INFO_DOWNLOAD_SIZE: 返回页面字节数
3)HTTP_INFO_DOWNLOAD_TIME: 返回页面下载时间
二、web_reg_save_param函数
1、函数用途
关联函数,保存文件下载信息
Action()
{
long flen; //文件大小
long lfbody; //响应数据内容大小
int HttpRetCode; //HTTP返回码
//保存文件句柄
web_set_max_html_param_len("1024000");
lr_rendezvous("download");
lr_start_transaction("download");
web_url("download",
"URL=http://192.168.17.39:8080/MDMServer/public/api/client/v1/appdownload.do?id=1711402&tenantName=saasdb1",
"Resource=1",
"RecContentType=application/x-msdownload",
"Mode=HTTP",
"Referer=",
LAST);
// //返回200,表示成功
HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
if (HttpRetCode == 200)
lr_output_message("The script. successfully accessed the page");
else
lr_error_message("The script. failed to access the page ");
//获取响应中的文件长度
flen = web_get_int_property(HTTP_INFO_DOWNLOAD_SIZE);
if(flen > 4805596)
lr_end_transaction("download", LR_PASS);
else
lr_end_transaction("download", LR_FAIL);
return 0;
}