code: private void setRequestHeaders(HttpURLConnection ucon, 
  			GenericUser authenticationUser, 
  			String[] requestHedaers) {
  		if(authenticationUser != null) {
  			String authenticationString = authenticationUser.getUserName() + ":" + authenticationUser.getPassword();
  			byte[] encodedAuthentication = Base64.encodeBase64(authenticationString.getBytes());
  			String authenticationHeaderValue = "Basic " + new String(encodedAuthentication);
  			ucon.setRequestProperty("Authorization", authenticationHeaderValue);
  		}
  		
  		for(int i = 0;i<requestHedaers.length;i = i+2) {
  			ucon.setRequestProperty(getReferenceService().namespaceString(requestHedaers[i]), getReferenceService().namespaceString(requestHedaers[i+1]));
  		}
  	}
docs: Add the request headers to the request
  
  @param ucon the connection to append the http headers to
  @param authenticationUser The username:password combination to pass along as basic http authentication
  @param requestHedaers the https header name:value pairs. This means the headers should always come in an even number (name + value) * n