httpmorph serves as a drop-in replacement for Python's requests library, utilizing a custom C implementation with BoringSSL for enhanced performance. It boasts features such as HTTP/2 support, realistic browser fingerprinting, and connection pooling, making it ideal for developers seeking to mimic browser interactions seamlessly.
httpmorph is an innovative Python HTTP client designed to replicate browser fingerprints effectively. It serves as a drop-in replacement for Python's popular requests library while leveraging a custom C implementation alongside BoringSSL to enhance performance and security.
requests.Using httpmorph is straightforward. Here’s a brief example demonstrating some of its capabilities:
import httpmorph
# Simple GET request
response = httpmorph.get('https://icanhazip.com')
print(response.status_code)
print(response.text)
# Sending a POST request with JSON data
response = httpmorph.post(
'https://httpbin.org/post',
json={'key': 'value'}
)
# Working with browser sessions
session = httpmorph.Session(browser='chrome')
response = session.get('https://example.com')
# Leveraging HTTP/2 support
client = httpmorph.Client(http2=True)
response = client.get('https://www.google.com')
print(response.http_version) # Should display '2.0'
httpmorph also supports advanced features such as:
httpmorph is built for compatibility with multiple platforms including Windows, macOS, and Linux, using BoringSSL for consistent TLS behaviors. With comprehensive testing and ongoing development, the library aims to be production-ready in the future while currently providing a robust and flexible HTTP client for developers needing speed and realistic browser interaction.
Explore the repository for detailed API documentation and contribution guidelines.
No comments yet.
Sign in to be the first to comment.