Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

py-message-headers

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

py-message-headers

Constants for IANA message headers (http, mime, mail, etc)

  • 2021.7.5
  • PyPI
  • Socket score

Maintainers
1

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: 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.
  2. Generates the headers, under the headers package, using the locally available CSV references 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

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc