summaryrefslogtreecommitdiff
path: root/examples/network/http_client.py
AgeCommit message (Collapse)Author
2024-08-28examples/network: Support full URLs in HTTP(S) client examples.Damien George
Not just the domain name. This gives better HTTP 1.0 examples if someone wants to copy them. Signed-off-by: Damien George <damien@micropython.org>
2024-08-28examples/network: Support IPv4 and IPv6 in HTTP client examples.Damien George
The main changes here are to pass the address family and socket type to `getaddrinfo()`, and then use the result of the address lookup when creating the socket, so it has the correct address family. This allows both IPv4 and IPv6 to work, because the socket is created with the correct AF_INETx type for the address. Also add some more comments to the examples to explain what's going on. Fixes issue #15580. Signed-off-by: Damien George <damien@micropython.org>
2023-06-08all: Replace all uses of umodule in Python code.Jim Mussared
Applies to drivers/examples/extmod/port-modules/tools. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2016-11-14examples/http_client: Use read() instead of readall().Paul Sokolovsky
2016-10-09examples/network/http_client*: Use \r\n line-endings in request.Paul Sokolovsky
2016-07-23examples/http_client*: Be sure to close socket.Paul Sokolovsky
Otherwise, on bare-metal/RTOS systems can lead to resource leaks.
2016-05-03examples/network/: Use getaddrinfo() result in easy way.Paul Sokolovsky
Instead of extracting 4th element, extact last. Much easier to remember!
2016-04-02examples/http_client.py: Introduce main() function.Paul Sokolovsky
Allows to re-run code if it was imported as a module (e.g., on bare-metal ports).
2016-04-02examples/http_client.py: Improve CPython compatibility in stream mode.Paul Sokolovsky
2016-04-01example/http_client.py: Remove unused code.Paul Sokolovsky
2016-04-01examples: http_client.py, http_server.py aren't just unix, move to network/.Paul Sokolovsky