How to pass apikey in java connection

Hi I am trying to connect (in java) and pass my apikey but I receive API-key format invalid.

            URL url=new URL(SERVICE_URL+SERVICE+"timestamp="+timestamp+"&signature="+encode(SECRETKEY, "timestamp="+timestamp));
			HttpURLConnection conn = (HttpURLConnection) url.openConnection();
			conn.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
			conn.setRequestProperty("accept", "application/json");
			conn.setRequestProperty("apiKey", APIKEY);
			conn.setRequestMethod("GET");
			conn.setDoOutput(true);
			System.out.println(url.toString());
			conn.connect();

found, I have to put this:
conn.setRequestProperty("X-MBX-APIKEY", APIKEY);