Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

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:

  1. Refers to the list of headers registered with IANA: . The definitions are available for download, as CSV files. These files are present in the references folder.
  2. Generates the headers, under the headers package, using the locally available CSV references files.


from headers import http, mime

request_headers.get(http.HOST) # provides access to the 'Host' header from the request

Other libraries

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for py-message-headers, version 2019.2.3
Filename, size File type Python version Upload date Hashes
Filename, size py_message_headers-2019.2.3-py2-none-any.whl (10.1 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size py-message-headers-2019.2.3.tar.gz (7.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page