Package cherrypy :: Package lib :: Module httputil :: Class HeaderMap
[hide private]
[frames] | no frames]

Class HeaderMap

source code

     object --+        
              |        
           dict --+    
                  |    
CaseInsensitiveDict --+
                      |
                     HeaderMap
Known Subclasses:

A dict subclass for HTTP request and response headers.

Each key is changed on entry to str(key).title(). This allows headers to be case-insensitive and avoid duplicates.

Values are header values (decoded according to :rfc:`2047` if necessary).

Instance Methods [hide private]
 
elements(self, key)
Return a sorted list of HeaderElements for the given header.
source code
list of D's values
values(self, key)
Return a sorted list of HeaderElement.value for the given header.
source code
 
output(self)
Transform self into a list of (name, value) tuples.
source code
 
encode(self, v)
Return the given header name or value, encoded for HTTP output.
source code

Inherited from CaseInsensitiveDict: __contains__, __delitem__, __getitem__, __setitem__, get, has_key, pop, setdefault, update

Inherited from dict: __cmp__, __eq__, __ge__, __getattribute__, __gt__, __init__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __sizeof__, clear, copy, items, iteritems, iterkeys, itervalues, keys, popitem, viewitems, viewkeys, viewvalues

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __str__, __subclasshook__

Class Methods [hide private]

Inherited from CaseInsensitiveDict: fromkeys

Class Variables [hide private]
  protocol = (1, 1)
  encodings = ['ISO-8859-1']
  use_rfc_2047 = True

Inherited from dict: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

values(self, key)

source code 

Return a sorted list of HeaderElement.value for the given header.

Returns: list of D's values
Overrides: dict.values