from .models import Response
from .packages.urllib3.poolmanager import PoolManager, ProxyManager
from .packages.urllib3.response import HTTPResponse
-from .hooks import dispatch_hook
from .compat import urlparse, basestring, urldefrag
from .utils import (DEFAULT_CA_BUNDLE_PATH, get_encoding_from_headers,
prepend_scheme_if_needed)
response.request = req
response.connection = self
- # Run the Response hook.
- response = dispatch_hook('response', req.hooks, response)
return response
def get_connection(self, url, proxies=None):
resp.history = tuple(history)
# Response manipulation hook.
- self.response = dispatch_hook('response', hooks, resp)
+ resp = dispatch_hook('response', hooks, resp)
return resp