The method getStatusLine() is undefined for the type HttpResponse
代码是网上拷下来的,在自己的eclipse上报错,代码如下:
HttpGet httpRequest = new HttpGet(uriAPI);
try
{
HttpResponse httpResponse = new DefaultHttpClient().execute(httpRequest);
if(httpResponse.getStatusLine().getStatusCode() == 200)
{
String strResult = EntityUtils.toString(httpResponse.getEntity());
}
else
{
}
代码是网上拷下来的,在自己的eclipse上报错,代码如下:
HttpGet httpRequest = new HttpGet(uriAPI);
try
{
HttpResponse httpResponse = new DefaultHttpClient().execute(httpRequest);
if(httpResponse.getStatusLine().getStatusCode() == 200)
{
String strResult = EntityUtils.toString(httpResponse.getEntity());
}
else
{
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货