I'm trying to send a POST request with a JSON body but I keep getting "Content type 'text/calendar;charset=UTF-8' not supported" error message. I tried with text/plain and changed my backend service to text/plain but I keep getting the same Content-type ... not supported error.
My backend service is returning a text in .ics (icalendar) format which I want to load on Outlook Calendar.
Here's what I'm trying on the client side (Outlook Macro VBA)
Set httpCall = CreateObject("MSXML2.ServerXMLHTTP")
URL = apiURL & apiPort & "/icalendar/unavailabilities"
httpCall.Open "POST", URL, False
httpCall.setRequestHeader "Content-Type", "text/calendar;charset=UTF-8"
httpCall.Send "{""requestedComponentTypeIdAndCount"": ""33"":""2""},""requestedStartTime"":""2021-05-20T08:00:00.000-05:00"",""requestedEndTime"":""2021-05-22T16:00:00.000-05:00""}"
MsgBox (httpCall.responseText)
Example of POST request I use with the same endpoint
The Request content-type should be application/json
text/calendar
is the response content-type, which typically would go as an "Accept" header: