Constants for IANA message headers (http, mime, mail, etc)
Reason this exists
Wouldn't it be better to retrieve Http header information using a Http header constants, like this
request_headers.get(http.REFERER). Constants such as
http.REFERER for the string
Referer reduces typos, and having to remember the exact spelling for Http headers.
This library does the following:
- Refers to the list of headers registered with IANA: https://www.iana.org/assignments/message-headers/message-headers.xhtml . The definitions are available for download, as CSV files. These files are present in the
- Generates the headers, under the
headerspackage, using the locally available CSV
from headers import http, mime ... request_headers.get(http.HOST) # provides access to the 'Host' header from the request mail_headers.get(mime.Content_Location) ...
- 'Http lazy headers': which also provides validation, and formatting options to the values that can be set to the Headers: https://github.com/nitely/http-lazy-headers
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for py-message-headers-2019.2.3.tar.gz
Hashes for py_message_headers-2019.2.3-py2-none-any.whl