Http请求获取返回值
HttpResponseresponse=client.execute(httpPost);//获取响应码status=response.getStatusLine().getStatusCode();HttpEntityhttpEntity=response.getEntity();//将H中返回实体转化为输入流InputStreamis=httpEntity.getContent();//读取输入流,即返回文本内容StringBuffersb=newStringBuffer();BufferedReaderbr=newBufferedReader(newInputStreamReader(is));Stringline="";while((line=br.readLine())!=null){sb.append(line);}Log.v("result","status="+status);Log.v("result","sb="+sb);
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。