new empty dictionary
|
__init__(self,
headers=[])
x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
|
|
|
|
__len__(self)
Return the total number of headers, including duplicates. |
|
|
|
|
__setitem__(self,
name,
val)
Set the value of a header. |
|
|
|
|
__delitem__(self,
name)
Delete all occurrences of a header, if present. |
|
|
|
|
__getitem__(self,
name)
Get the first header value for 'name' |
|
|
|
v, remove specified key and return the corresponding value
|
pop(self,
name,
default=None)
If key is not found, d is returned if given, otherwise KeyError is
raised |
|
|
|
True if D has a key k, else False
|
has_key(self,
name)
Return true if the message contains the header. |
|
|
|
True if D has a key k, else False
|
__contains__(self,
name)
Return true if the message contains the header. |
|
|
|
|
get_all(self,
name)
Return a list of all the values for the named field. |
|
|
|
D[k] if k in D, else d
|
get(self,
name,
default=None)
Get the first header value for 'name', or return 'default' |
|
|
|
list of D's keys
|
keys(self)
Return a list of all the header field names. |
|
|
|
list of D's values
|
values(self)
Return a list of all header values. |
|
|
|
list of D's (key, value) pairs, as 2-tuples
|
items(self)
Get all the header fields and values. |
|
|
|
|
|
|
|
__str__(self)
str() returns the formatted headers, complete with end line, suitable
for direct HTTP transmission. |
|
|
|
D.get(k,d), also set D[k]=d if k not in D
|
setdefault(self,
name,
value)
Return first matching header value for 'name', or 'value' |
|
|
|
|
add_header(self,
_name,
_value,
**_params)
Extended header setting. |
|
|
|
|
elements(self,
key)
Return a list of HeaderElements for the given header (or None). |
|
|
|
Inherited from dict:
__cmp__,
__eq__,
__ge__,
__getattribute__,
__gt__,
__hash__,
__iter__,
__le__,
__lt__,
__ne__,
__new__,
clear,
copy,
fromkeys,
iteritems,
iterkeys,
itervalues,
popitem,
update
Inherited from object:
__delattr__,
__reduce__,
__reduce_ex__,
__setattr__
|