RequestX Documentation¶
RequestX is a high-performance HTTP client library for Python that provides a drop-in replacement for the popular requests library. Built with Rust for speed and memory safety, it offers both synchronous and asynchronous APIs while maintaining full compatibility with the familiar requests interface.
🚀 Key Features¶
Drop-in replacement for requests library with identical API
High performance leveraging Rust’s speed and memory safety
Dual API support - both sync and async/await patterns
Cross-platform compatibility (Windows, macOS, Linux)
Requests compatibility for easy migration from existing codebases
Native async/await support with automatic context detection
Session management with persistent connections and cookies
Comprehensive error handling with requests-compatible exceptions
⚡ Performance¶
RequestX delivers significant performance improvements over traditional Python HTTP libraries:
2-5x faster than requests for synchronous operations
3-10x faster than aiohttp for asynchronous operations
Lower memory usage due to Rust’s efficient memory management
Better connection pooling with hyper’s advanced HTTP/2 support
📦 Quick Installation¶
pip install requestx
🔥 Quick Start¶
RequestX works exactly like requests - just change the import:
# Before (requests)
import requests
response = requests.get('https://httpbin.org/json')
print(response.json())
# After (requestx) - same API!
import requestx
response = requestx.get('https://httpbin.org/json')
print(response.json())
Async/await support:
import asyncio
import requestx
async def main():
# Same API, but now works in async context!
response = await requestx.get('https://httpbin.org/json')
print(response.json())
asyncio.run(main())
📚 Documentation Contents¶
User Guide
API Reference
Examples
- Examples
- Basic Usage Examples
- Simple GET Request
- GET with Parameters
- POST with Form Data
- POST with JSON Data
- Custom Headers
- Working with Response Data
- HTTP Methods
- Basic Authentication
- Handling Cookies
- Timeout Configuration
- Error Handling
- File Upload
- Query String Building
- Response Status Checking
- Working with Different Content Types
Development
🤝 Community & Support¶
Discussions: https://github.com/neuesql/requestx/discussions
📄 License¶
RequestX is released under the MIT License. See the LICENSE file for details.