
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
A Python library for simplified HTTP requests, featuring rate limiting, browser-like headers, and automatic retries. Built on the official `requests` library for reliability.
A Python library for simplified HTTP requests, featuring rate limiting, browser-like headers, and automatic retries. Built on the official requests
library for reliability.
pip install easy-requests
from easy_requests import Connection, init_cache
init_cache(".cache")
connection = Connection()
# to generate headers that mimic the browser
connection.generate_headers()
response = connection.get("https://example.com")
from easy_requests import Connection
import cloudscraper
connection = Connection(cloudscraper.create_scraper())
response = connection.get("https://example.com")
This won't use caching without you configuring it.
You can configure the default cache either with environment variables or using init_cache
. The env keys are EASY_REQUESTS_CACHE_DIR
and EASY_REQUESTS_CACHE_EXPIRES
(in days).
from easy_requests import init_cache
init_cache(".cache")
Alternatively you can pass arguments into Connection(...)
and the request function:
cache_enabled: Optional[bool]
cache_directory: Optional[str]
cache_expires_after: Optional[timedelta]
from easy_requests import Connection
Connection(
cache_enabled = True
)
If you pass in cache_enabled=True
it will raise a Value error if no cache directory was found.
FAQs
A Python library for simplified HTTP requests, featuring rate limiting, browser-like headers, and automatic retries. Built on the official `requests` library for reliability.
We found that easy-requests demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.