web_custom_request的一个简单实战

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;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值