Python Forum
HTTP Headers as constants in stdlib
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HTTP Headers as constants in stdlib
#1
Hello everyone,
While working with HTTP headers in python, am usually faced with the situation of setting or requesting for some common header information; be it
headers.get('Host')
or something similar.
I was wondering if the python standard library (or any other library) defines constants for these headers' names, so that the developer need not type out the string equivalent for them.
I came across this in the Rust documentation: https://docs.rs/http/0.1.15/http/header/...#constants, which is exactly what I would like to see in the Python library.
Any suggestions on where I can look for this? I didn't have any luck doing a web search, or via the python console.

Thank you,
Kiran
Reply


Messages In This Thread
HTTP Headers as constants in stdlib - by kirans - Jan-31-2019, 06:12 AM
RE: HTTP Headers as constants in stdlib - by kirans - Jan-31-2019, 10:03 AM
RE: HTTP Headers as constants in stdlib - by nilamo - Jan-31-2019, 04:30 PM
RE: HTTP Headers as constants in stdlib - by wavic - Jan-31-2019, 05:37 PM
RE: HTTP Headers as constants in stdlib - by wavic - Feb-02-2019, 10:52 AM
RE: HTTP Headers as constants in stdlib - by kirans - Feb-03-2019, 03:38 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Extracting Headers from Many Pages Quickly OstermanA 2 2,023 Oct-01-2019, 08:01 AM
Last Post: OstermanA

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020