Google Calendar REST API错误

罗汉

我试图在meteor.js中实现对Google Calendar API的简单POST调用,但遇到了麻烦。我的要求看起来像这样:

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."
    }
}

有任何想法吗?

罗汉

解决了。真傻

取出参数,然后改成“ body”“ data”即可。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章