python-request-fanout

make multiple requests concurrently and get their responses


Keywords
async, fanout, python, request
License
MIT
Install
pip install python-request-fanout==1.0.1

Documentation

It allows multiple requests to be made asynchronously.

This can be done.

pip3 install python-request-fanout

###Example:

import requests

from python_request_fanout.requester import HTTPMethod, Requester
request_array = [
    requests.Request(
        HTTPMethod.GET.name,
        url="https://www.google.com"
    ),
    requests.Request(
        HTTPMethod.GET.name,
        url="https://www.udemy.com"
    ),
    requests.Request(
        HTTPMethod.GET.name,
        url="https://www.youtube.com"
    ),
    requests.Request(
        HTTPMethod.POST.name,
        url="https://www.github.com"
    ),
]
response_array = Requester.do_requests(request_array)
assert len(response_array) == 4

Sample diagram

diagram