Commit 62cf6981 authored by Ashwin Ramaswami's avatar Ashwin Ramaswami Committed by Julien Palard

bpo-35649: update http client example (GH-11441)

parent 1a13efb7
......@@ -516,8 +516,11 @@ Here is an example session that uses the ``GET`` method::
>>> # The following example demonstrates reading data in chunks.
>>> conn.request("GET", "/")
>>> r1 = conn.getresponse()
>>> while not r1.closed:
... print(r1.read(200)) # 200 bytes
>>> while True:
... chunk = r1.read(200) # 200 bytes
... if not chunk:
... break
... print(repr(chunk))
b'<!doctype html>\n<!--[if"...
...
>>> # Example of an invalid request
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment