In the Digi MicroPython Programming Guide it would be helpful to explicitly mention that we need to use the version of urequests.py that is on your GitHub site.
The one from micropython-lib bombs on this statement:
ai = usocket.getaddrinfo(host, port, 0, usocket.SOCK_STREAM)
TypeError: function takes 2 positional arguments but 4 were given
I was able to tweak it, but then I discovered today, from Rob Faludi’s blog post (https://www.digi.com/blog/hands-on-micropython-programming-examples-for-edge-computing-part-2/) that you had already tweaked it!
The places I recommend that you place such a note are:
- “The ussl module: Sample code”, step 5, where you say, “Make use of urequests.py…”
- Explicitly list it in “MicroPython libraries on GitHub”.
This is an important module for invoking RESTful APIs.