Today, I need to get some information from the header and check some information. I need to pay attention to the following points:
- request.META.get("header key") is used to get header information
- Note that the header key must be prefixed with HTTP and capitalized. For example, if your key is username, it should be written as: request.META.get("HTTP_USERNAME")
- In addition, when your header key has a dash, it will be automatically converted to an underscore, for example, my-user is written as: request.META.get("HTTP_MY_USER")