Saturday, 15 May 2021

requests.get(, stream=True) with Python standard library

Per ps aux, it seems that import requests adds ~4mb of RAM to a code I'm trying to optimize.

The usage of requests in the respective code is pretty basic, and I read that the "regular" requests.get can be achieved via the standard library:

from urllib.request import urlopen

urlopen("www.bla.com").read()

There is however a case where verify=True, stream=True is being used.

Can this also be somehow reasonably achieved via Python (3.8) standard library?



from requests.get(, stream=True) with Python standard library

No comments:

Post a Comment