[Python-checkins] cpython (2.7): update example, since python.org is HTTPS-only now (closes #24118)

benjamin.peterson python-checkins at python.org
Sun May 3 19:00:43 CEST 2015


https://hg.python.org/cpython/rev/376c2d81d0e2
changeset:   95874:376c2d81d0e2
branch:      2.7
parent:      95864:b32ca610c9e6
user:        Benjamin Peterson <benjamin at python.org>
date:        Sun May 03 13:00:21 2015 -0400
summary:
  update example, since python.org is HTTPS-only now (closes #24118)

files:
  Doc/library/httplib.rst |  10 +++++-----
  1 files changed, 5 insertions(+), 5 deletions(-)


diff --git a/Doc/library/httplib.rst b/Doc/library/httplib.rst
--- a/Doc/library/httplib.rst
+++ b/Doc/library/httplib.rst
@@ -591,13 +591,13 @@
 Here is an example session that uses the ``GET`` method::
 
    >>> import httplib
-   >>> conn = httplib.HTTPConnection("www.python.org")
-   >>> conn.request("GET", "/index.html")
+   >>> conn = httplib.HTTPSConnection("www.python.org")
+   >>> conn.request("GET", "/")
    >>> r1 = conn.getresponse()
    >>> print r1.status, r1.reason
    200 OK
    >>> data1 = r1.read()
-   >>> conn.request("GET", "/parrot.spam")
+   >>> conn.request("GET", "/")
    >>> r2 = conn.getresponse()
    >>> print r2.status, r2.reason
    404 Not Found
@@ -608,8 +608,8 @@
 ``HEAD`` method never returns any data. ::
 
    >>> import httplib
-   >>> conn = httplib.HTTPConnection("www.python.org")
-   >>> conn.request("HEAD","/index.html")
+   >>> conn = httplib.HTTPSConnection("www.python.org")
+   >>> conn.request("HEAD","/")
    >>> res = conn.getresponse()
    >>> print res.status, res.reason
    200 OK

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list