Code example for Header

Methods: getValue

0
	static String getHeader(HttpResponse response, String key) {
		Header header = response.getFirstHeader(key);
		if(header == null)
			return null; 
		else 
			return header.getValue();
	} 
	 
	/// read all http response body as a string 
	static String getBodyAsString(HttpResponse response) {
		try { 
	        ByteArrayOutputStream baos = new ByteArrayOutputStream();
	        byte[] buf = new byte[2048];
	        InputStream is = response.getEntity().getContent();
	        for(int i = 0; i != -1; i = is.read(buf))
	        	baos.write(buf, 0, i);
	        return Utilities.getUTF8String(baos.toByteArray());
        } catch (Exception e) {
        	return null; 
        } 
Connect your IDE to all the code out there  Get Codota for Java