Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`web`.`client`.`CookieAgent``

class documentation

`class CookieAgent: (source)`

Implements interfaces: `twisted.web.iweb.IAgent`

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 Since
11.1

Method | `__init__` | Undocumented
Method | `request` | Issue a new request to the wrapped `Agent`.
Instance Variable | `cookieJar` | Initialized cookie jar to read cookies from and store cookies to.
Method | `_extractCookies` | Extract response cookies and store them in the cookie jar.
Instance Variable | `_agent` | Underlying Twisted Web agent to issue requests through.

def __init__(self, agent, cookieJar): (source)

Undocumented

def request(self, method, uri, headers=None, bodyProducer=None): (source)
from `twisted.web.iweb.IAgent`

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 Also
`Agent.request`

cookieJar: `cookielib.CookieJar` = (source)

Initialized cookie jar to read cookies from and store cookies to.

def _extractCookies(self, response, request): (source)

Extract response cookies and store them in the cookie jar.

Parameters
response:`twisted.web.iweb.IResponse` | Twisted Web response.
request | A urllib2 compatible request object.

_agent: `twisted.web.client.Agent` = (source)

Underlying Twisted Web agent to issue requests through.