Paras
Paras

Reputation: 3491

How to specify a Preferred timezone for Outlook API in request headers

I need to create an event on my calendar, so I'm using Microsoft Graph API for this. Since I don't want to add TimeZone every time in my request I was trying to add it in the request header, however I'm getting the certain errors such as

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

I'll be using Retrofit to call this API, my integration is on a Spring based application.

Upvotes: 2

Views: 7445

Answers (1)

Jason Johnston
Jason Johnston

Reputation: 17702

You need to surround the timezone name with double quotes:

Prefer: outlook.timezone="Pacific Standard Time"

enter image description here

Upvotes: 3

Related Questions