Code example for DefaultHttpClient

Methods: execute, setParams

0
        HttpClientParams.setRedirecting(params, true);
         
        if (mHttpClient == null){
			mHttpClient = new DefaultHttpClient();
		} 
		mHttpClient.setParams(params);
		 
//		DefaultCoookieStore cookieStore = DefaultCoookieStore.getInstance(MyHealth.getCurrentContext()); 
//		mHttpClient.setCookieStore(cookieStore); 
		 
        HttpGet get = new HttpGet(mUrl);
        HttpResponse response = mHttpClient.execute(get);
//		cookieStore.saveCookies(MyHealth.getCurrentContext()); 
         
        int statusCode = response.getStatusLine().getStatusCode();
        if (statusCode == 200) {
            return EntityUtils.toString(response.getEntity(), "UTF-8");
        } 
 
        return null; 
	}