麻烦问一下web.rest和inet.http有什么区别?为什么返回值不一致?测试不同的网站有的时候三种方法返回的一致,有的只能用其中的二种,比如下面的例子,法一和法三能够得到预期的结果,但是法二不行,这是什么原因呢?@光庆
import console;
import web.rest.jsonLiteClient;
import web.rest.jsonClient;
import web.json;
import inet.http;
//法一
function get_stdinfo_nssi (number,url,data){
var http = inet.http();
var content = http.post(url,data);
var content1 = web.json.parse(content);
http.close();
return content1;}
//法二
function get_stdinfo_nssi_2 (number,url,data){
var http = web.rest.jsonClient();
var content = http.post(url,data);
http.close();
return content;}
//法三
function get_stdinfo_nssi_3 (number,url,data){
var http = web.rest.jsonLiteClient();
var content = http.post(url,data);
http.close();
return content;}
number = "LY/T 1232-2015";
url = "https://www.nssi.org.cn/cssn/front/standard/selectStandardListByCond"
data ={
"cond.orderBy": "",
"cond.keywords": number,
"cond.activeValue":"全部",
"cond.yearStartValue": "",
"cond.yearEndValue": "",
"cond.publishCorpA104": "",
"cond.chinaClassCN": "",
"cond.aboradClassICSN": "",
"cond.otherpublishCorpGroup": "",
"cond.account_id": "",
"cond.login_name": "",
"cond.superKeyWord": "",
"cond.superKeyWordChoose": "",
"cond.advanced_search": "",
"cond.A100": "",
"cond.caiyong": "",
"cond.super_A101": "",
"cond.super_standarnumber": "",
"cond.super_w_level_s": "",
"cond.super_w_location_s": "",
"cond.super_tips_s": "",
"cond.w_level_s": "",
"cond.w_source_s": "",
"cond.w_location_s": "",
"cond.tips_s": "",
"cond.shouye_a100": "",
"cond.resulttype": 0,
"cond.secondword": "",
"cond.loadPage": "true",
"cond.containFullTextValue": "否",
"cond.whetherSearchAll": 0,
"page": 1,
"limit": 10,
"start": 0}
info = get_stdinfo_nssi(number,url,data);
info1 = get_stdinfo_nssi_2 (number,url,data)
info2 = get_stdinfo_nssi_3 (number,url,data)
console.dump(info);
console.dump(info1);
console.dump(info2);
console.pause(true);