Package wsgiwapi :: Module wsgisupport :: Class Headers
[frames] | no frames]

Class Headers

source code

object --+
         |
        Headers

Instance Methods
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
set(self, header, value, params={}, **kwargs)
Set the value of a header.
source code
 
add(self, header, value, params={}, **kwargs)
Add a header value.
source code
 
get_first(self, header, default=None)
Get the first value of a named header.
source code
 
get_all(self, header)
Get all values of a named header.
source code
 
remove(self, header)
Remove any occurrences of the named header.
source code
 
items(self)
Get the list of headers.
source code
 
__str__(self)
Get a string representation of the headers.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

set(self, header, value, params={}, **kwargs)

source code 

Set the value of a header.

If any values for the header already exist in the list of headers, they are first removed. The comparison of header names is performed case insensitively.

add(self, header, value, params={}, **kwargs)

source code 

Add a header value.

FIXME - document

get_first(self, header, default=None)

source code 

Get the first value of a named header.

Returns default if no values of the named header exist.

get_all(self, header)

source code 

Get all values of a named header.

Returns the values in the order in which they were added.

Returns an empty list if no values of the named header are present.

remove(self, header)

source code 

Remove any occurrences of the named header.

The comparison of header names is performed case insensitively.

items(self)

source code 

Get the list of headers.

This returns a list of tuple pairs, (header, value), one for each header, in the order added. The strings in the tuples are byte strings, encoded appropriately for HTTP transmission.

__str__(self)
(Informal representation operator)

source code 
Get a string representation of the headers.
Overrides: object.__str__