t.w.c.CookieAgent(object) : class documentation

Part of twisted.web.client View Source View In Hierarchy

CookieAgent extends the basic Agent to add RFC-compliant handling of HTTP cookies. Cookies are written to and extracted from a cookielib.CookieJar instance.

The same cookie jar instance will be used for any requests through this agent, mutating it whenever a Set-Cookie header appears in a response.

Present Since11.1
Instance Variable cookieJar Initialized cookie jar to read cookies from and store cookies to. (type: cookielib.CookieJar)
Method __init__ Undocumented
Method request Issue a new request to the wrapped Agent.
Instance Variable _agent Underlying Twisted Web agent to issue requests through. (type: twisted.web.client.Agent)
Method _extractCookies Extract response cookies and store them in the cookie jar.
_agent =
Underlying Twisted Web agent to issue requests through. (type: twisted.web.client.Agent)
cookieJar =
Initialized cookie jar to read cookies from and store cookies to. (type: cookielib.CookieJar)
def __init__(self, agent, cookieJar): (source)
Undocumented
def request(self, method, uri, headers=None, bodyProducer=None): (source)
Issue a new request to the wrapped Agent.

Send a Cookie header if a cookie for uri is stored in CookieAgent.cookieJar. Cookies are automatically extracted and stored from requests.

If a 'cookie' header appears in headers it will override the automatic cookie header obtained from the cookie jar.

See AlsoAgent.request
def _extractCookies(self, response, request): (source)
Extract response cookies and store them in the cookie jar.
ParametersresponseTwisted Web response. (type: twisted.web.iweb.IResponse)
requestA urllib2 compatible request object.
API Documentation for Twisted, generated by pydoctor at 2012-09-01 11:44:56.