microsoft-graph-api - 如何在请求 header 中指定 Outlook API 的首选时区

标签 microsoft-graph-api outlook-restapi

我需要在日历上创建一个事件,因此我为此使用 Microsoft Graph API。由于我不想每次在请求中添加 TimeZone,因此我尝试将其添加到请求 header 中,但是我收到了某些错误,例如

An error occurred when parsing the HTTP header 'Prefer'. The header value 'outlook.timezone=Pacific Standard Time' is incorrect at position '25' because 'S' is not a recognized separator. The supported separators are ',', ';', and '='.

enter image description here

我将使用 Retrofit 来调用此 API,我的集成是基于 Spring 的应用程序。

最佳答案

您需要用双引号将时区名称引起来:

Prefer: outlook.timezone="Pacific Standard Time"

enter image description here

关于microsoft-graph-api - 如何在请求 header 中指定 Outlook API 的首选时区,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48148850/

相关文章:

c# - Microsoft Graph 和无用户访问

microsoft-graph-api - Microsoft Graph API 测试版 - 报告返回加密/散列的 userPrincipalName

microsoft-graph-api - Outlook Rest API : Download the email attachments of type . 使用 Outlook Rest API 的 eml 文件

Outlook 365 OAuth 535 5.7.3 认证不成功

rest - Outlook.com REST API

ios - Office365获取消息并过滤来自谁

python - 如何通过OAuth2获取授权 token 并通过http请求读取Outlook邮件?

azure - 使用App Model V2访问日历

azure-active-directory - 能否使用 Azure AD 作为身份提供商从 Azure AD B2C 登录获取 MSGraph 访问 token ?