diff --git a/examples/network/http_client.py b/examples/network/http_client.py index df66ace2a588d3e4176df6b29618cbceb7159cac..b245a721ac939d867dfb9fb34eb5f8f683ead7e8 100644 --- a/examples/network/http_client.py +++ b/examples/network/http_client.py @@ -18,10 +18,10 @@ def main(use_stream=False): # MicroPython socket objects support stream (aka file) interface # directly, but the line below is needed for CPython. s = s.makefile("rwb", 0) - s.write(b"GET / HTTP/1.0\n\n") + s.write(b"GET / HTTP/1.0\r\n\r\n") print(s.readall()) else: - s.send(b"GET / HTTP/1.0\n\n") + s.send(b"GET / HTTP/1.0\r\n\r\n") print(s.recv(4096)) s.close() diff --git a/examples/network/http_client_ssl.py b/examples/network/http_client_ssl.py index 46e039830f876c58a7524c9b52fd33d162338bd2..83f685fdf35db0589a3e3d5c0a87fb8264ffb1c6 100644 --- a/examples/network/http_client_ssl.py +++ b/examples/network/http_client_ssl.py @@ -24,12 +24,12 @@ def main(use_stream=True): if use_stream: # Both CPython and MicroPython SSLSocket objects support read() and # write() methods. - s.write(b"GET / HTTP/1.0\n\n") + s.write(b"GET / HTTP/1.0\r\n\r\n") print(s.read(4096)) else: # MicroPython SSLSocket objects implement only stream interface, not # socket interface - s.send(b"GET / HTTP/1.0\n\n") + s.send(b"GET / HTTP/1.0\r\n\r\n") print(s.recv(4096)) s.close()