Thanks @aveao -- Unfortunately, although I agree it's definitely convenient to have as much stuff installed by default as possible, I don't think we're likely to make this change.
it's already included by default with esp8266 but somehow isn't with the rest of network-capable boards.
This is a bit of a historical accident with the esp8266, it includes too much stuff by default, I think at the time there was excitement about having the first network-capable board and providing features for the kickstarter. It's always easy to add stuff but then we can almost never remove it.
We've also made it easier to install packages since then (e.g. mip).
provides an easy way to stream HTTP requests (which urequests can't do)
Can you explain more what you mean by this? If you have a Response object from requests, you can use resp.raw to access the underlying socket. (This is true of upstream requests too). Not sure if that's what you meant by streaming though?
this PR changes it so that all boards that install bundle-networking get urllib.urequest too.
This is the problem -- it's a huge decision to add the additional firmware size to every single board, especially when there's already requests, when people who need it can just install it from mip.
Hey! I also think it is better to update the header in line 39 of
micropython-lib/micropython/urllib.urequest/urllib/urequest.pyas,As I know, most major web servers and CDNs provide backward compatibility. Therefore there will be no harm by updating it.
HTTP/2 is a binary protocol and uses HPACK for header compression. Changing this, require additional code to handle the protocol and header compression.
I also think the change to HTTP/1.1 may require some additional code, to handle the different connection types :
close,keep-alive.In addition, there are different Transfer-Endocings.
It would be good to merge back some of the changes from the CircuitPython requests library (they've updated it since originally starting with the MicroPython implementation). In it, they respond with v1.1, though I'm not sure it 100% conforms to spec...
https://github.com/adafruit/Adafruit_CircuitPython_Requests/blob/main/adafruit_requests.py