public static boolean sendRequest(String request) { InputStream inputStream = null; try { URL url = new URL(request); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setReadTimeout(TIMEOUT); connection.setConnectTimeout(TIMEOUT); connection.setRequestMethod("POST"); connection.connect(); inputStream = connection.getInputStream(); while (inputStream.read() != -1); return true; } catch (IOException error) { return false; } finally { try { if (inputStream != null) { inputStream.close(); } } catch (IOException secondError) { Log.w(RequestManager.class.getSimpleName(), secondError); } }}我如何從 inputreader.read() 讀取數(shù)據(jù)?我想讀取從服務(wù)器發(fā)回的數(shù)據(jù)
添加回答
舉報(bào)
0/150
提交
取消