String url = "https://www.baidu.com/";
try {
URL oracle = new URL(url);
URLConnection conn = oracle.openConnection();//或HttpURLConnection connect = (HttpURLConnection) connection.openConnection();
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String inputLine = null;
while((inputLine = br.readLine()) != null){
// JSONObject jsonObject = JSON.parseObject(inputLine);
// JSONArray value = jsonObject.getJSONArray("value");
// JSON.parseObject(value.toString(),new TypeReference<List<Map<String,Object>>>(){});
// value.stream().forEach(v->{
// Map<String,Object> map = JSONObject.parseObject(v.toString(), Map.class);
//
// });
System.out.println(inputLine);
}
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
} catch (IOException e) {
e.printStackTrace();
}