Skip to content

Commit

Permalink
Pass response_kw to HTTPConnectionPool through HTTPAdapter.send
Browse files Browse the repository at this point in the history
  • Loading branch information
joren485 committed Sep 9, 2023
1 parent 8812812 commit 01282cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/requests/adapters.py
Expand Up @@ -431,7 +431,7 @@ def proxy_headers(self, proxy):
return headers

def send(
self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None
self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None, **response_kwargs,
):
"""Sends PreparedRequest object. Returns Response object.
Expand All @@ -446,6 +446,7 @@ def send(
must be a path to a CA bundle to use
:param cert: (optional) Any user-provided SSL certificate to be trusted.
:param proxies: (optional) The proxies dictionary to apply to the request.
:param response_kwargs: (optional) Additional arguments passed to HTTPConnectionPool.urlopen.
:rtype: requests.Response
"""

Expand Down Expand Up @@ -494,6 +495,7 @@ def send(
retries=self.max_retries,
timeout=timeout,
chunked=chunked,
**response_kwargs
)

except (ProtocolError, OSError) as err:
Expand Down

0 comments on commit 01282cc

Please sign in to comment.