Skip to content
Snippets Groups Projects
Commit 00a9590e authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

examples/http_client: Use read() instead of readall().

parent 59a1201d
Branches
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ def main(use_stream=False): ...@@ -19,7 +19,7 @@ def main(use_stream=False):
# directly, but the line below is needed for CPython. # directly, but the line below is needed for CPython.
s = s.makefile("rwb", 0) s = s.makefile("rwb", 0)
s.write(b"GET / HTTP/1.0\r\n\r\n") s.write(b"GET / HTTP/1.0\r\n\r\n")
print(s.readall()) print(s.read())
else: else:
s.send(b"GET / HTTP/1.0\r\n\r\n") s.send(b"GET / HTTP/1.0\r\n\r\n")
print(s.recv(4096)) print(s.recv(4096))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment