t.w.h.Headers(object) : class documentation

Part of twisted.web2.http_headers View Source View In Hierarchy

This class stores the HTTP headers as both a parsed representation and the raw string representation. It converts between the two on demand.
Method __init__ Undocumented
Method hasHeader Does a header with the given name exist?
Method getRawHeaders Returns a list of headers matching the given name as the raw string given.
Method getHeader Ret9urns the parsed representation of the given header. The exact form of the return value depends on the header in question.
Method setRawHeaders Sets the raw representation of the given header. Value should be a list of strings, each being one header of the given name.
Method setHeader Sets the parsed representation of the given header. Value should be a list of objects whose exact form depends on the header in question.
Method addRawHeader Add a raw value to a header that may or may not already exist. If it exists, add it as a separate header to output; do not replace anything.
Method removeHeader Removes the header named.
Method __repr__ Undocumented
Method canonicalNameCaps Return the name with the canonical capitalization, if known, otherwise, Caps-After-Dashes
Method getAllRawHeaders Return an iterator of key,value pairs of all headers contained in this object, as strings. The keys are capitalized in canonical capitalization.
Method makeImmutable Make this header set immutable. All mutating operations will raise an exception.
Method _setRawHeaders Undocumented
Method _toParsed Undocumented
Method _toRaw Undocumented
Method _mutateRaise Undocumented
def __init__(self, headers=None, rawHeaders=None, handler=DefaultHTTPHandler): (source)
Undocumented
def _setRawHeaders(self, headers): (source)
Undocumented
def _toParsed(self, name): (source)
Undocumented
def _toRaw(self, name): (source)
Undocumented
def hasHeader(self, name): (source)
Does a header with the given name exist?
def getRawHeaders(self, name, default=None): (source)
Returns a list of headers matching the given name as the raw string given.
def getHeader(self, name, default=None): (source)

Ret9urns the parsed representation of the given header. The exact form of the return value depends on the header in question.

If no parser for the header exists, raise ValueError.

If the header doesn't exist, return default (or None if not specified)
def setRawHeaders(self, name, value): (source)
Sets the raw representation of the given header. Value should be a list of strings, each being one header of the given name.
def setHeader(self, name, value): (source)
Sets the parsed representation of the given header. Value should be a list of objects whose exact form depends on the header in question.
def addRawHeader(self, name, value): (source)
Add a raw value to a header that may or may not already exist. If it exists, add it as a separate header to output; do not replace anything.
def removeHeader(self, name): (source)
Removes the header named.
def __repr__(self): (source)
Undocumented
def canonicalNameCaps(self, name): (source)
Return the name with the canonical capitalization, if known, otherwise, Caps-After-Dashes
def getAllRawHeaders(self): (source)
Return an iterator of key,value pairs of all headers contained in this object, as strings. The keys are capitalized in canonical capitalization.
def makeImmutable(self): (source)
Make this header set immutable. All mutating operations will raise an exception.
def _mutateRaise(self, *args): (source)
Undocumented
API Documentation for Twisted, generated by pydoctor at 2011-10-27 15:57:47.