您的位置:首页 > 产品设计 > UI/UE

web_custom_request的一个简单实战

2016-12-14 13:23 459 查看
Action()

{

web_set_max_html_param_len("2048");

//$header={'Content-type:application/json'};

    web_add_header("Content-type","application/json");

web_reg_find("Text=6d1a7fc7jw1dr7gvb5xwwj.jpg",

             "SaveCount=Welcome_Count",

             "Search=Body",

LAST);

    

    web_reg_save_param("error",

        "LB=",

        "RB=",

        "NotFound=ERROR",

        "Search=Body",

        LAST);

//

    lr_start_transaction("test");

web_custom_request("CCService.asmx_3",

"URL=http://IP/getlocation.json?source=2059928203",

"Method=POST",

"Resource=0",

"RecContentType=application/json",

"Referer=",

"Mode=HTTP",

"EncType=text/xml;charset=utf-8",

"Body={\"version\"=>\"0.1.0\",\"host\"=>\"locate.place.cn/location/\",\"radio_type\"=>\"gsm\",\"request_address\"=>true,\"decode_pos\"=>true,\"address_language\"=>\"zh_CN\",\"uid\"=>111111,\"ip\"=>'192.168.101.1',\"user_agent\"=>'ua',\"platform\"=>'platform',\"wm\"=>\"3333\",\"from\"=>\"111111\",\"location\"=>{\"latitude\"=>39.98437,\"longitude\"=>116.30987,},\"cell_towers\"=>{{\"cell_id\"=>26630,\"location_area_code\"=>4569,\"mobile_country_code\"=>460,\"mobile_network_code\"=>0,\"signal_strength\"=>0,},{\"cell_id\"=>657,\"location_area_code\"=>4566,\"mobile_country_code\"=>460,\"mobile_network_code\"=>0,\"signal_strength\"=>0,},},\"wifi_towers\"=>{{\"mac_address\"=>\"01:23:45:67:89:ab\",\"signal_strength\"=>8,\"age\"=>0},{\"mac_address\"=>\"01:23:45:67:89:ac\",\"signal_strength\"=>4,\"age\"=>0},}}",

LAST);

if(atoi(lr_eval_string("{Welcome_Count}"))>0){

    lr_end_transaction("test",LR_PASS);

}

else{

    lr_end_transaction("test",LR_FAIL);

    lr_error_message("error=%s",lr_eval_string("{error}"));

return 0;

}

    return0;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: