Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP SSL pipelining in Python

Tags:

python

http

I’m working on a Python app that needs to send hundreds of HTTP requests in a short period of time to a web service that is SSL-only. Is there any support for HTTP Pipelining in Python?

like image 895
andrewdotn Avatar asked Aug 21 '26 04:08

andrewdotn


1 Answers

I was able to solve this using Python's grequests module. As documented in issue 13, it's as simple as:

s = requests.session()
rs = [grequests.get(url, session=s) for url in urls]
grequests.map(rs)
like image 130
andrewdotn Avatar answered Aug 23 '26 21:08

andrewdotn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!