title: http 411 error for GCM push notification
body: <p>I am trying to hit the gcm cloud to get the notification</p>
  
  <p>I created web restfull web service I implemented the following code but I get the below error</p>
  
  <pre><code>String gurl = "https://android.googleapis.com/gcm/send";
  URL url = new URL(gurl);
  HttpURLConnection con = (HttpURLConnection) url.openConnection();
  con.setRequestMethod("POST");
  
  con.setRequestProperty("Authorization", "key=" + apikey);
  con.setRequestProperty("registration_ids",regid);
  con.setRequestProperty("data", "message="+msg);
  con.setRequestProperty("Content-Length", "0");
  
  con.setDoOutput(true);
  
  
  int responseCode = con.getResponseCode();
  System.out.println("\nSending 'POST' request to URL : " + url);
  System.out.println("Response Code : " + responseCode);
  
  BufferedReader in = new BufferedReader(
          new InputStreamReader(con.getInputStream()));
  String inputLine;
  StringBuffer response = new StringBuffer();
  
  while ((inputLine = in.readLine()) != null) {
      response.append(inputLine);
  }
  in.close();
  
  // 7. Print result
  System.out.println(response.toString());
  //return response.toString();
  return response.toString();
  </code></pre>
  
  <p>I get the error like</p>
  
  <pre><code>VERE: The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container
  java.io.IOException: Server returned HTTP response code: 411 for URL: https://android.googleapis.com/gcm/send
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
  at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1676)
  at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1674)
  at java.security.AccessController.doPrivileged(Native Method)
  at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1672)
  at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1245)
  at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
  at com.madhu.pack.SimpleWS.chattest1(SimpleWS.java:250)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:606)
  at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
  at 
  </code></pre>
  
  <p>And so on...</p>
  
  <p>I'm posting the data from android client. So can you guys help me out of the problem?</p>