谷歌日历REST API错误

问题描述:

我想实现meteor.js到谷歌日历API一个简单的POST调用,我被困。我的要求是这样的:

I'm trying to implement a simple POST call in meteor.js to the Google Calendar API, and I'm stuck. My request looks like this:

var id = Meteor.http.post("https://www.googleapis.com/calendar/v3/calendars/", {
    'headers' : { 
      'Authorization': auth, // auth = "Bearer " + Meteor.user().services.google.accessToken
      'Content-Type': 'application/json' 
    },
    'parameters': {},
    'body' : { 
      'title': "Calendar Title",
    }
  });

和我得到以下错误:

Error: failed [400] {
    "error": {
        "errors": [{
            "domain": "global",
            "reason": "required",
            "message": "Missing title."
        }],
    "code": 400,
    "message": "Missing title."
    }
}

任何想法?

解决它。这是愚蠢的。

取出参数,使身体,数据,而不是和它的作品。

Take out parameters, and make "body" "data" instead and it works.