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 
          { 
            
          }