From: Benjamin Peterson Date: Sun, 3 May 2015 16:59:09 +0000 (-0400) Subject: update example, since python.org is HTTPS-only now (closes #24118) X-Git-Tag: v3.5.0b1~250^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ac87ed7e9f0239b78459197cee3ddb1d2e77bc58;p=thirdparty%2FPython%2Fcpython.git update example, since python.org is HTTPS-only now (closes #24118) --- diff --git a/Doc/library/http.client.rst b/Doc/library/http.client.rst index 632430591d93..807f6852486c 100644 --- a/Doc/library/http.client.rst +++ b/Doc/library/http.client.rst @@ -615,18 +615,18 @@ Examples Here is an example session that uses the ``GET`` method:: >>> import http.client - >>> conn = http.client.HTTPConnection("www.python.org") - >>> conn.request("GET", "/index.html") + >>> conn = http.client.HTTPSConnection("www.python.org") + >>> conn.request("GET", "/") >>> r1 = conn.getresponse() >>> print(r1.status, r1.reason) 200 OK >>> data1 = r1.read() # This will return entire content. >>> # The following example demonstrates reading data in chunks. - >>> conn.request("GET", "/index.html") + >>> conn.request("GET", "/") >>> r1 = conn.getresponse() >>> while not r1.closed: ... print(r1.read(200)) # 200 bytes - b'\n