Constants for IANA message headers (http, mime, mail, etc)
Project description
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
references
folder. - Generates the headers, under the
headers
package, using the locally available CSVreferences
files.
Usage
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)
...
Other libraries
- '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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for py-message-headers-2019.2.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ccfc0385be8ed707048cbb5668c16794c4f448b80377f2c6b975893484a9d10 |
|
MD5 | 01429df42fd1264dc141f820323bf693 |
|
BLAKE2b-256 | 5e87ad4ab7d387430242364e5d2ccc5e7dc04027eb23ae15b31737354f2166e7 |
Close
Hashes for py_message_headers-2019.2.3-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a757eaba9b9b041165e2ede2da43c18a7e36b08da68f3852f1d7e5b6e8078c22 |
|
MD5 | 7453b84658de58c83e73bacc28e19adc |
|
BLAKE2b-256 | dfb5cacb9d31025149444d8d2cf286d10b7ced1a821316b4942d8f89bfcc4d5a |