bpo-12707: deprecate info(), geturl(), getcode() methods in favor of headers, url, and status properties for HTTPResponse and addinfourl (GH-11447)
Co-Authored-By: epicfaace <aramaswamis@gmail.com>
diff --git a/Doc/library/http.client.rst b/Doc/library/http.client.rst
index db26d56..a458ab7 100644
--- a/Doc/library/http.client.rst
+++ b/Doc/library/http.client.rst
@@ -484,6 +484,14 @@
HTTP protocol version used by server. 10 for HTTP/1.0, 11 for HTTP/1.1.
+.. attribute:: HTTPResponse.url
+
+ URL of the resource retrieved, commonly used to determine if a redirect was followed.
+
+.. attribute:: HTTPResponse.headers
+
+ Headers of the response in the form of an :class:`email.message.EmailMessage` instance.
+
.. attribute:: HTTPResponse.status
Status code returned by server.
@@ -501,6 +509,21 @@
Is ``True`` if the stream is closed.
+.. method:: HTTPResponse.geturl()
+
+ .. deprecated:: 3.9
+ Deprecated in favor of :attr:`~HTTPResponse.url`.
+
+.. method:: HTTPResponse.info()
+
+ .. deprecated:: 3.9
+ Deprecated in favor of :attr:`~HTTPResponse.headers`.
+
+.. method:: HTTPResponse.getstatus()
+
+ .. deprecated:: 3.9
+ Deprecated in favor of :attr:`~HTTPResponse.status`.
+
Examples
--------