HttpGet httpget = new HttpGet("http://www.google.com/");
System.out.println("executing request " + httpget.getURI());
// Create a response handler
ResponseHandler<String> responseHandler = new BasicResponseHandler();
String responseBody = httpclient.execute(httpget, responseHandler);
這將得到responseBody作爲「字符串」,如何獲得btye []與httpclient.execute(..)?我想得到byte []的原因是因爲我想寫入其他輸出流httpclient 4如何獲得字節
是否精細離開BAOS不是封閉在這裏,否則就要由BAOS明確地將其關閉。關() ? – 2017-03-28 18:20:20