werkzeug.EnvironHeaders
¶
-
class
werkzeug.
EnvironHeaders
(environ)[source]¶ Read only version of the headers from a WSGI environment. This provides the same interface as Headers and is constructed from a WSGI environment.
From Werkzeug 0.3 onwards, the KeyError raised by this class is also a subclass of the
BadRequest
HTTP exception and will render a page for a400 BAD REQUEST
if caught in a catch-all for HTTP exceptions.
Methods¶
__init__ (environ) |
|
add (item) |
|
add_header (item) |
|
clear () |
Clears all headers. |
copy () |
|
extend (iterable) |
|
get (key[, default, type, as_bytes]) |
Return the default value if the requested data doesn’t exist. |
get_all (name) |
Return a list of all the values for the named field. |
getlist (key[, type, as_bytes]) |
Return the list of items for a given key. |
has_key (key) |
Check if a key is present. |
insert (pos, value) |
|
items (*a, **kw) |
Like iteritems() , but returns a list. |
iteritems ([lower]) |
|
iterkeys ([lower]) |
|
itervalues () |
|
keys (*a, **kw) |
Like iterkeys() , but returns a list. |
pop ([index]) |
|
popitem () |
|
remove (item) |
|
set (key, value) |
|
setdefault (key, default) |
|
to_list ([charset]) |
Convert the headers into a list suitable for WSGI. |
to_wsgi_list () |
Convert the headers into a list suitable for WSGI. |
values (*a, **kw) |
Like itervalues() , but returns a list. |