标签:http
HttpResponse response = client.execute(httpPost); //获取响应码 status = response.getStatusLine().getStatusCode(); HttpEntity httpEntity = response.getEntity(); //将H中返回实体转化为输入流 InputStream is = httpEntity.getContent(); //读取输入流,即返回文本内容 StringBuffer sb = new StringBuffer(); BufferedReader br = new BufferedReader(new InputStreamReader(is)); String line = ""; while((line=br.readLine())!=null){ sb.append(line); } Log.v("result", "status = " + status); Log.v("result", "sb = " + sb);
本文出自 “爬过山见过海” 博客,请务必保留此出处http://670176656.blog.51cto.com/4500575/1632360
标签:http
原文地址:http://670176656.blog.51cto.com/4500575/1632360