'Issue a new request to the wrapped L{Agent}.
Send a I{Cookie} header if a cookie for C{uri} is stored in
L{CookieAgent.cookieJar}. Cookies are automatically extracted and
stored from requests.
If a C{\'cookie\'} header appears in C{headers} it will override the
automatic cookie header obtained from the cookie jar.
@see: L{Agent.request}'

def request(self, method, uri, headers=None, bodyProducer=None):

    if (headers is None):
        headers = Headers()
    lastRequest = _FakeUrllib2Request(uri)
    if (not headers.hasHeader('cookie')):
        self.cookieJar.add_cookie_header(lastRequest)
        cookieHeader = lastRequest.get_header('Cookie', None)
        if (cookieHeader is not None):
            headers = headers.copy()
            headers.addRawHeader('cookie', networkString(cookieHeader))
    d = self._agent.request(method, uri, headers, bodyProducer)
    d.addCallback(self._extractCookies, lastRequest)
    return d
