GCM connectivity using PostURL

GCM connectivity using PostURL

Hi everyone,

Im trying to send data to Google Cloud Messaging server using zoho creator...

Here is what i have done so far...

P.S. - postfields is a JSON array.

  1.      void api.apiCall()
  2.      {
  3.         httpheader = map();
  4.         httpheader.put("Authorization", "key=A************************************");
  5.         httpheader.put("Content-Type", "application/json");
  6.         postfields = " {\" registration_ids\":[\"sEvg******************************\"],\"data\":{\"message\":\"my message\"}}";
  7.         response = postUrl("https://android.googleapis.com/gcm/send", postfields, httpheader);
  8.         info response;
          }
I am getting bad request error.

I would really appreciate if somebody could help me out on this one...
Thanks.