修改控制器及新增城市功能
This commit is contained in:
		| @@ -18,7 +18,7 @@ public class WeatherUtils | ||||
|         //buffer用于接受返回的字符 | ||||
|         StringBuffer buffer = new StringBuffer(); | ||||
|         try { | ||||
|             //建立URL,把请求地址给补全,其中urlencode()方法用于把params里的参数给取出来 | ||||
|             //拼接url连接 | ||||
|             URL url = new URL(requestUrl+"?"+urlencode(params)); | ||||
|             //打开http连接 | ||||
|             HttpURLConnection httpUrlConn = (HttpURLConnection) url.openConnection(); | ||||
| @@ -40,7 +40,6 @@ public class WeatherUtils | ||||
|             bufferedReader.close(); | ||||
|             inputStreamReader.close(); | ||||
|             inputStream.close(); | ||||
|             inputStream = null; | ||||
|             //断开连接 | ||||
|             httpUrlConn.disconnect(); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user