Python Requests - Throttle Download Speed

I run a large file upload (2.8 GB) in Python, the code I use looks something like this:

files = {'md5': ('', md5hash), 'modified': ('', now), 'created': ('', now), 'file': (os.path.basename(url), fileobject, 'application/octet-stream')} m = requests_toolbelt.MultipartEncoder(fields=files) headers['content-type'] = m.content_type r = s.post(url, data=m, params=params, headers=headers) 

When I run this code, everything else on my network just stops working. Websites stop working, etc. I am assuming Python is saturating my router TCP buffer packet or something like that. This behavior will be well known to everyone who tried to run the BitTorrent client without specifying restrictions on their download speed.

Is there any way to slow down the download speed so that my users do not destroy their network?

+1
python python-requests
source share

No one has answered this question yet.

See similar questions:

10
Bandwidth throttling in Python
8
SSL Bandwidth Throttling

or similar:

5504
Does Python have a ternary conditional operator?
5231
What are metaclasses in Python?
4473
Calling an external command in Python
3790
How can I safely create a subdirectory?
3602
Does Python have a "contains" substring method?
3119
What is the difference between Python list methods that are added and expanded?
2818
Finding an index of an element with a list containing it in Python
2601
How can I make a time delay in Python?
2568
How to find out the current time in Python
2097
Is there a way to run Python on Android?

All Articles