I am trying to push some data to a URL (MDS_CS) for BES
when I set some request headers in my code and submit the request, the sent request header is null .
here is my code:
HttpURLConnection conn =(HttpURLConnection)url.openConnection(); conn.setDoInput(true);//For receiving the confirmation conn.setDoOutput(true);//For sending the data conn.setRequestMethod("POST");//Post the data to the proxy conn.setRequestProperty("X-Rim-Push-ID", pushId); conn.setRequestProperty("Content-Type", "text/html"); conn.setRequestProperty("X-Rim-Push-Title", "-message"); conn.setRequestProperty("X-Rim-Push-Type", "browser-message"); conn.setRequestProperty("X-Rim-Push-Dest-Port", "7874"); //Write the data OutputStream out = conn.getOutputStream(); out.write(data.getBytes()); out.close(); System.out.println(conn.getHeaderField("X-Rim-Push-ID"));
the last line returns null when I try to get the X-Rim-Push-Title NULL only the X-Rim-Push-ID , which is correctly retrieved,
Please help me
source share