|
用易语言返回的文本是:[JavaScript] 纯文本查看 复制代码 “{
"Result": 30000,
"ErrMsg": "Success",
"Data": {
"total": 5,
"data": [
{
"strategy": "one",
"status": 1,
"comment": "信息部一",
"cycle_time": "2021-03-16",
"time": "00:00",
"enabled": "no",
"id": 1,
"mac": "马赛克"
},
{
"strategy": "week",
"status": 1,
"comment": "会议室电脑",
"cycle_time": "6",
"time": "14:00",
"enabled": "no",
"id": 2,
"mac": "马赛克"
},
{
"strategy": "one",
"status": 1,
"comment": "信息部二",
"cycle_time": "2021-06-19",
"time": "00:00",
"enabled": "no",
"id": 3,
"mac": "马赛克"
},
{
"strategy": "one",
"status": 1,
"comment": "主电脑",
"cycle_time": "2021-12-11",
"time": "00:00",
"enabled": "no",
"id": 4,
"mac": "马赛克"
},
{
"strategy": "one",
"status": 1,
"comment": "H2BK",
"cycle_time": "2022-09-15",
"time": "00:00",
"enabled": "no",
"id": 5,
"mac": "马赛克"
}
]
}
} 用JAVA返回的是:[JavaScript] 纯文本查看 复制代码 {
"Result": 30000,
"ErrMsg": "Success",
"Data": {
"total": 5,
"data": [
{
"status": 1,
"time": "14:00",
"id": 2,
"mac": "马赛克",
"strategy": "week",
"comment": "会议室电脑",
"enabled": "no",
"cycle_time": "6"
},
{
"status": 1,
"time": "00:00",
"id": 3,
"mac": "马赛克",
"strategy": "one",
"comment": "信息部二",
"enabled": "no",
"cycle_time": "2021-06-19"
},
{
"status": 1,
"time": "00:00",
"id": 4,
"mac": "马赛克",
"strategy": "one",
"comment": "主电脑",
"enabled": "no",
"cycle_time": "2021-12-11"
},
{
"status": 1,
"time": "00:00",
"id": 5,
"mac": "马赛克",
"strategy": "one",
"comment": "H2BK",
"enabled": "no",
"cycle_time": "2022-09-15"
}
]
}
} 缺少一个data,第一个data被吃了···
下面是代码 求解
[mw_shl_code=java,true]import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
/*
* 调用时如果需要cookie 则在dopost前使用
*
* */
public class HttpClient {
补充内容 (2022-11-24 14:18):
JAVA 用的是HttpClient |
|