diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-10-09 19:36:04 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-10-09 19:36:04 +0300 |
commit | fa5ac678fc628775a4c65a19bbaea02ef05b25dc (patch) | |
tree | d7b58056546c6f1e9e86ebf108592124531c3e4f | |
parent | 3dabaae47d7f813ce506950f590d302cc8cbc0d9 (diff) | |
download | micropython-fa5ac678fc628775a4c65a19bbaea02ef05b25dc.tar.gz micropython-fa5ac678fc628775a4c65a19bbaea02ef05b25dc.zip |
examples/network/http_client*: Use \r\n line-endings in request.
-rw-r--r-- | examples/network/http_client.py | 4 | ||||
-rw-r--r-- | examples/network/http_client_ssl.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/network/http_client.py b/examples/network/http_client.py index df66ace2a5..b245a721ac 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 46e039830f..83f685fdf3 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() |