ui:use("tb_json")
local m_json=rxi_new_json()
function test_get()
local outTNS = CTNString();
local sURL=[[http://192.168.1.3:9851/action/test?file=uums_login&cmd=uums_login&user=sysadmin&pass=81dc9bdb52d04dc20036dbd8313ed055&to_json=1]];
cutil:httpGet(sURL, outTNS);
local outStr = outTNS:get();
print(cutil:u2a(outStr));
end
function test_post_param()
local outTNS = CTNString();
local sCParamS = CParamString()
sCParamS:add('Content-Type:application/json;charset=UTF-8');
local sURL=[[http://192.168.1.3:9851/action/test]];
?
local tbInParam={}
tbInParam['file']='uums_login';
tbInParam['cmd']='uums_login';
tbInParam['user']='sysadmin';
tbInParam['pass']='81dc9bdb52d04dc20036dbd8313ed055';
tbInParam['to_json']='1';
local sInJson=m_json.encode(tbInParam)
cutil:httpPostWithHead(sURL, outTNS, sInJson,sCParamS);
local outStr = outTNS:get();
print(cutil:u2a(outStr));
end
test_post_param();