http - Google Calendar V3 REST API 中的批量请求

标签 http rest google-api google-calendar-api gdata-api

如何通过 V3 REST API 使用批量请求获取/添加/更新 Google 日历事件?我已经尝试过但没有用。根据文档 ( https://developers.google.com/google-apps/calendar/batch ),应该可以通过向 API 发布多部分/混合内容类型消息来发送批处理请求。一个有效的 HTTP POST 示例会很棒。

谢谢, 里亚兹

最佳答案

我发现外层网址一定是"https://www.googleapis.com/batch/calendar/v3/" 并且边界 url 必须是 "/calendar/v3/calendars/{calendarID}/events"

完整的 HTTP 请求如下所示:

POST /batch/calendar/v3 HTTP/1.1
Authorization: /*Auth token*/
Host: host
Content-Type: multipart/mixed; boundary=batch_foobarbaz
Content-Length: total_content_length

--batch_foobarbaz
Content-ID: 1

GET /calendar/v3/calendars/{calendarID1}/events

--batch_foobarbaz
Content-ID: 2

GET /calendar/v3/calendars/{calendarID2}/events

--batch_foobarbaz--

关于http - Google Calendar V3 REST API 中的批量请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17425934/

相关文章:

c# - 多个客户端的 Rest Web 服务和 session 处理

java - 如何在 Java 中覆盖 Dropwizard/Jetty 参数以获得高性能?

php - Google Oauth 2.0 检查我的刷新访问 token 是否过期

security - 仅用于登录页面的 HTTPS - 是否推荐?

ios - 解码从 HTTP API 请求接收到的数据

c++ - 从 C++ 代码与 servlet 交互

c++ - 如何将视频文件作为输入传递给 NodeJS 中的子进程并接收帧/图像作为输出?

python - Google 文档列表 API 已弃用 : how can one manipulate spreadsheets in Python now?

python - 如何将服务帐户与 Google 的 python api 和驱动器一起使用?

java - 带有代理的 Java 中的 HTTP 基本身份验证