title: Sending a message to C2DM keeps returning 401
body: <p>I have been trying this for two days already with no success. My goal is to send a short message to the C2DM. I have used a simple Java application and curl, but it keeps returning response code 401: (Unauthorized).</p>
  
  <p>The first curl command:</p>
  
  <pre><code>curl https://www.google.com/accounts/ClientLogin -d Email=firstname.lastname@gmail.com -d Passwd=mypasswd -d accountType=HOSTED_OR_GOOGLE -d source=Google-cURL-Example -d service=ac2dm
  </code></pre>
  
  <p>returns three long strings: SID, LSID and Auth.</p>
  
  <p>Next, I copy the Auth string to the following command (AUTH_STRING):</p>
  
  <pre><code>curl --header "Authorization: GoogleLogin auth=AUTH_STRING" "https://android.clients.google.com/c2dm/send" -d registration_id=SOME_REGISTRATION_ID -d "data.message=HelloWorld" -d collapse_key=0 -k
  </code></pre>
  
  <p>but it always returns response code 401. The registration_id is copied from the Android client app and it should be valid.</p>
  
  <p>What's wrong with this? Any help is appreciated.</p>