Code example for DefaultHttpClient

Methods: executegetConnectionManagergetCookieStoresetCookieStore

0
         * @throws IOException 
         * @throws HQTPAPIException 
         */ 
        protected String send(HttpUriRequest request) throws ClientProtocolException, IOException,
                HQTPAPIException { 
            DefaultHttpClient client = new DefaultHttpClient();
            client.setCookieStore(cookie_store);
            String response_str;
            try { 
                response_str = client.execute(request, new StringResponseHandler());
            } catch (ClientProtocolException e) {
                throw new HQTPAPIException(e.getMessage());
            } finally { 
                client.getConnectionManager().shutdown();
            } 
 
            cookie_store = client.getCookieStore();
            return response_str;
        } 
 
        /** 
         * A class that converts HttpResponse to String with some checks. 
Contextual code suggestions in your IDE  Get Codota for Java