Code example for HttpResponse

Methods: getEntity, getFirstHeader, getStatusLine

0
		request.setHeader(ACCEPT_KEY, ACCEPT_DEFAULT_VALUE);
		request.setHeader(USER_AGENT_KEY, sUserAgent);
		AndroidHttpClient.modifyRequestToAcceptGzipResponse(request);
		Log.xd(this, request);
		HttpResponse response = mClient.execute(request);
		int statusCode = response.getStatusLine().getStatusCode();
		if (statusCode == HttpStatus.SC_MOVED_TEMPORARILY || statusCode == HttpStatus.SC_MOVED_PERMANENTLY) {
			Header firstHeader = response.getFirstHeader("Location");
			if (firstHeader != null) {
				HttpGet redirectUri = new HttpGet(firstHeader.getValue());
				/*Header[] allHeaders = response.getAllHeaders(); 
				for (Header resHeader : allHeaders) { 
					redirectUri.addHeader(resHeader);	 
				}*/ 
				request.abort();
				return getInputSteam(redirectUri);
			} 
		} 
		Log.xd(this, request);
		if (mResponseStatusHandler != null) {
			mResponseStatusHandler.statusHandle(this, request, response);
		} 
		/*Header contentEncoding = response.getFirstHeader(CONTENT_ENCODING); 
		boolean isGzipResponse = false; 
		if (contentEncoding != null) { 
			isGzipResponse = contentEncoding != null && GZIP.equalsIgnoreCase(contentEncoding.getValue()); 
		}*/ 
		HttpEntity httpEntity = response.getEntity();
		return AndroidHttpClient.getUngzippedContent(httpEntity);
		/* 
		content = httpEntity.getContent(); 
		if (isGzipResponse) { 
			content = new GZIPInputStream(content);