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 7b0e038
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/requests/adapters.py
Expand Up @@ -431,7 +431,14 @@ 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 +453,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 +502,7 @@ def send(
retries=self.max_retries,
timeout=timeout,
chunked=chunked,
**response_kwargs,
)

except (ProtocolError, OSError) as err:
Expand Down

0 comments on commit 7b0e038

Please sign in to comment.