Send multiple requests using 3 lines of code!
Project description
MultiGather
You can install package by:
pip install MultiGather
Simple example for POST:
import asyncio
from MultiGather.Client import Connection
from MultiGather.Types import Config, Request
# Replace with the actual URL for your POST endpoint.
url = "https://your-api-endpoint/posts"
# Replace with the data you want to send in the POST request
data = {"title": "New Post", "body": "This is a sample post content", "userId": 1}
async def main():
client = Connection(Config(timeout=10)) # Set timeout to 10 seconds (optional)
# Prepare a POST request object
post_request = Request(method="POST", url=url, json=data, amount=5) ## gonna send 5 requests
# Send the requests asynchronously and collect responses
responses = await client.sendRequest(post_request)
# Print the status code for each response
for response in responses:
print(f"POST response status: {response.status}")
asyncio.run(main())
Simple example for GET:
import asyncio
from MultiGather.Client import Connection
from MultiGather.Types import Config, Request
# Replace with the actual URL for your GET endpoint.
url = "https://your-api-endpoint/posts"
async def main():
client = Connection(Config(timeout=10)) # Set timeout to 10 seconds (optional)
# Prepare a GET request object
get_request = Request(method="GET", url=url, amount=5) # send 5 requests.
# Send the requests asynchronously and collect responses
responses = await client.sendRequest(get_request)
# Print the status code for each response
for response in responses:
print(f"GET response status: {response.status}")
asyncio.run(main())
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
multigather-0.0.8.tar.gz
(2.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file multigather-0.0.8.tar.gz.
File metadata
- Download URL: multigather-0.0.8.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96b49078f6b04934ae799d8047b57e9c962c78c54a33e4aabc2ee035c2070e2c
|
|
| MD5 |
5d7fa32664ccd5ef5d0d317ad2d87b35
|
|
| BLAKE2b-256 |
5854b902d0e5c606a81fa9af95a7e09523ee0fcf743c353b5486ae6ca50666e5
|
File details
Details for the file MultiGather-0.0.8-py3-none-any.whl.
File metadata
- Download URL: MultiGather-0.0.8-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9321e0eab61595cc5199e9c58484a97060139fc85ee9fcf3041b99778a717f1
|
|
| MD5 |
758498512baed9abd77524c47015ea83
|
|
| BLAKE2b-256 |
db8730a6efb071ec2b7557f9615ab413e9a8da7c1e6d7f53d685c75b65dcd1bf
|