summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorAlexey Namyotkin <62434915+nametkin@users.noreply.github.com>2023-05-16 06:20:30 (GMT)
committerGitHub <noreply@github.com>2023-05-16 06:20:30 (GMT)
commit85ec192ac4b000d4e47df6123b65eacbd1fdccfa (patch)
tree6029b8cda6865e42154c9bcea0e419c8ba0f54eb /Doc/library
parent24d8b88420b81fc60aeb0cbcacef1e72d633824a (diff)
downloadcpython-85ec192ac4b000d4e47df6123b65eacbd1fdccfa.zip
cpython-85ec192ac4b000d4e47df6123b65eacbd1fdccfa.tar.gz
cpython-85ec192ac4b000d4e47df6123b65eacbd1fdccfa.tar.bz2
gh-69152: add method get_proxy_response_headers to HTTPConnection class (#104248)
Add http.client.HTTPConnection method get_proxy_response_headers() - this is a followup to https://github.com/python/cpython/pull/26152 which added it as a non-public attribute. This way we don't pre-compute a headers dictionary that most users will never access. The new method is properly public and documented and triggers full proxy header parsing into a dict only when actually called. --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/http.client.rst11
1 files changed, 11 insertions, 0 deletions
diff --git a/Doc/library/http.client.rst b/Doc/library/http.client.rst
index bf1f2e3..46d616a 100644
--- a/Doc/library/http.client.rst
+++ b/Doc/library/http.client.rst
@@ -394,6 +394,17 @@ HTTPConnection Objects
one will be automatically generated and transmitted if not provided in
the headers argument.
+
+.. method:: HTTPConnection.get_proxy_response_headers()
+
+ Returns a dictionary with the headers of the response received from
+ the proxy server to the CONNECT request.
+
+ If the CONNECT request was not sent, the method returns an empty dictionary.
+
+ .. versionadded:: 3.12
+
+
.. method:: HTTPConnection.connect()
Connect to the server specified when the object was created. By default,