Found the fix: need to have something in the header User-Agent
"The remote server returned an error: (400) Bad Request when downloading outlook.office365.com and outlook.live.com ical/ics file using WebRequest.Create()
I'm getting "The remote server returned an error: (400) Bad Request" when trying to download outlook.office365.com and outlook.live.com ical/ics file using WebRequest.Create(). For example:
var outlook = "https://outlook.office365.com/owa/calendar/1553ff8f8cbf4066b750e3727958f281@masked/46044022e24c45469dee6721bf92c6374486754768175751168/calendar.ics";
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(outlooklive);
myRequest.Method = "GET";
WebResponse myResponse = myRequest.GetResponse();
myResponse.Close();
However it works for google and icloud calendar.
Any idea why?