When calling an URL on my Django API it returns:
[04/Sep/2021 08:14:47] WARNING [django.request:224] Not Acceptable: /api/calendar/test.ics
Calling the same URL from PostMan (or curl) returns a simple iCal file so the URL is valid and returning.
What I found was that the cause is the "Accept" headers sent by the client. The problem is that the request never actually hits my view so I cannot inspect request.META for the value of the received accept header.
How can I discover, serverside, what headers were sent and what their values are?
Still not sure what is going on. But, If you want to inspect the headers, you can define add the
dispatchfunction to your class based view, something like:The strange thing is, now with the
dispatchfunction added to the view, the request is somehow accepted.