A simple HTTP library in Python similar to JavaScript fetch.
Project description
📦 Fetch HTTP Library
Welcome to the Fetch HTTP Library! This library provides a simple and efficient way to make HTTP requests in Python. It supports GET, POST, PUT, and DELETE methods, and handles responses gracefully.
🚀 Features
- 🌐 GET requests
- 📤 POST requests
- ✏️ PUT requests
- ❌ DELETE requests
- 📦 Singleton pattern to ensure a single instance
- 🛠️ Easy to use and extend
- 📝 Logging for better traceability
📚 Installation
To install the required dependencies, run:
pip install fetchio
🛠️ Usage
Here's a quick example of how to use the Fetch HTTP Library:
from fetchio.http import Http
http = Http()
# GET request
response = http.get('http://example.com')
print(response)
# POST request
response = http.post('http://example.com', json={'data': 'value'})
print(response)
# PUT request
response = http.put('http://example.com', json={'data': 'value'})
print(response)
# DELETE request
response = http.delete('http://example.com')
print(response)
🧪 Running Tests
To run the tests, make sure you have pytest installed:
pip install -r requirements.txt
Then, run the tests with:
pytest
📄 License
This project is licensed under the MIT License. See the LICENSE file for details.
🤝 Contributing
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
📞 Contact
For any questions or inquiries, please contact us at tal7aouy@gmail.com.
Made with ❤️ by Mhammed Talhaouy
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 fetchio-1.0.0.tar.gz.
File metadata
- Download URL: fetchio-1.0.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80f3f675f13f66aaf46d7a84d16e22924077145ef729c905bc20f683e2261e85
|
|
| MD5 |
b1ad8d43215034ef92e3b4f4577ed43b
|
|
| BLAKE2b-256 |
4ed34662f76e3e9b0fa676c3b87b939029a45f08d9ad73ea49cb9abd347faada
|
File details
Details for the file fetchio-1.0.0-py3-none-any.whl.
File metadata
- Download URL: fetchio-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2707a7099c502035e86f520e454ae040411199983a8e941157e35e25950e03a
|
|
| MD5 |
a563e04910e84b0e7cbdfcd2eabd5aa8
|
|
| BLAKE2b-256 |
e6afb8cd1589bea4330af2715890a7b7771bb831184aea6a034e4ca59892f377
|