Code example for HttpException

0
		HttpUriRequest request = new HttpGet(url);
		request.setHeader("Accept-Encoding", "gzip");
		request.setHeader("User-Agent", "gzip");
		response = client.execute(request);
		if (response.getStatusLine().getStatusCode() != 200) {
			throw new HttpException("Server error: "
					+ response.getStatusLine().getStatusCode());
		} else { 
			responseString = parseResponse(response);
 
		} 
		return responseString;
	} 
 
	/** 
	 * does an HTTP Post to the url specified using the params passed in 
	 *  
	 * @param url 
	 * @param params 
	 * @return 
Contextual code suggestions in your IDE  Get Codota for Java