Code example for HttpGet

0
            Log.e(LOG_TAG, "path=" + dirRelativePath + " recurse=" + recurse + " mode=" +
                    modeString, e);
            return new LinkedList<String>();
        } 
 
        HttpGet httpRequest = new HttpGet(url.toString());
        ResponseHandler<LinkedList<String>> handler = new ResponseHandler<LinkedList<String>>() {
            @Override 
            public LinkedList<String> handleResponse(HttpResponse response)
                    throws IOException { 
                LinkedList<String> lines = new LinkedList<String>();
 
                if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
                    return lines;
                } 
                HttpEntity entity = response.getEntity();
                if (entity == null) {
                    return lines;
                } 
 
                BufferedReader reader =
                        new BufferedReader(new InputStreamReader(entity.getContent()));
                String line;
                try { 
                    while ((line = reader.readLine()) != null) {
                        lines.add(line);
                    } 
                } finally { 
                    if (reader != null) {
                        reader.close();
                    } 
                } 
 
                return lines;
            } 
        }; 
 
        try { 
            return getHttpClient().execute(httpRequest, handler);
        } catch (IOException e) {
            Log.e(LOG_TAG, "getLayoutTestsDirContents(): HTTP GET failed for URL " + url);
            return null; 
        } 
    } 
Connect your IDE to all the code out there  Get Codota for Java