def fetch(self, request, callback, *args, **kwargs): method, url = _request_info(request) recording.pre_call_hook('HTTP', method, url, None) def wrapper(request, callback, response, *args): recording.post_call_hook('HTTP', method, url, None) callback(response) super(AsyncHTTPClient, self).fetch( request, functools.partial(wrapper, request, callback), *args, **kwargs)
def fetch(self, request, callback, *args, **kwargs): method, url = _request_info(request) recording.pre_call_hook('HTTP', method, url, None) def wrapper(request, callback, response, *args): recording.post_call_hook('HTTP', method, url, None) callback(response) super(AsyncHTTPClient, self).fetch(request, functools.partial(wrapper, request, callback), *args, **kwargs)
def fetch(self, request, *args, **kwargs): method, url = _request_info(request) recording.pre_call_hook('HTTP', method, url, None) response = super(HTTPClient, self).fetch(request, *args, **kwargs) recording.post_call_hook('HTTP', method, url, None) return response