private void processHeaders(HttpURLConnection conn) throws Exception{
		headers = new HashMap<String, String>();
		cookies = new HashMap<String, String>();
		
		//=================================
		//get headers, cookies, etc.
		for (int i=0; ; i++) {
			
			//get headers from header field
			String headerName = conn.getHeaderFieldKey(i);
			String headerValue = conn.getHeaderField(i);
			
			//end of headers -> break
			if(headerName == null && headerValue == null){
				break;
			}
			
			//cookies
			if(headerName != null && headerName.equals("Set-Cookie")){
				//process cookies!
				processCookies(headerValue);
				
				//we don't need the Set-Cookie anymore
				continue;
			}
			
			//put header field
			headers.put(headerName, headerValue);
		}
	}