谷歌日历REST API错误 [英] Google Calendar REST API errors

查看:145
本文介绍了谷歌日历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.

这篇关于谷歌日历REST API错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆