Search code examples
djangohttp-headerstastypie

HTTP headers in Django


I need to perform some logic based on cucsom headers. I'm using Chrome's postman to add the headers.

But it seems like I can only add them when the header name doesn't have a '_' Is there any reason for this ?

ideally i would like to add a header somthing like 'MY_HEADER' and access it via request.META['MY_HEADER'], right now I'm adding it as 'MYHEADER' and accessing it via request.META['MYHEADER']


Solution

  • Thank you vanadium23, Turns out Nginx was making changes. Full answer here Why underscores are forbidden in HTTP header names