summaryrefslogtreecommitdiff
path: root/examples/network/https_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: Use SSLContext instead of old ssl.wrap_socket.Damien George
`ssl.wrap_socket()` is deprecated in CPython, so use `SSLContext` instead, so the example is a good example to copy. 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>
2024-05-13examples/network: Rename SSL examples to start with https.Damien George
It's better for discoverability to have these examples named `https_xxx.py` rather than `http_xxx_ssl.py`. Signed-off-by: Damien George <damien@micropython.org>