Code example for HttpHost

0
        try { 
            client = AndroidHttpClient.newInstance("Android");
            HttpUriRequest req = new HttpGet(url);
 
            if (isProxySet) {
                HttpHost proxy = new HttpHost(proxyHost, proxyPort);
                ConnRouteParams.setDefaultProxy(req.getParams(), proxy);
            } 
 
            req.addHeader(
                    "Accept", 
                    "*/*, application/vnd.wap.mms-message, application/vnd.wap.sic"); 
 
            req.addHeader(
                    "x-wap-profile", 
                    "http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-20021212#"); 
 
            HttpResponse response = client.execute(req);
            StatusLine status = response.getStatusLine();
            if (status.getStatusCode() != 200) { // HTTP 200 is success.
Connect your IDE to all the code out there  Get Codota for Java