
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
request-session
is an HTTP library built on top of requests
that makes your live easier by retrying whenever a request fails,
logs the results or even sends metrics and traces to DataDogHQ.
RequestSession also measures the time of the request.
Use RequestSession
to create a client module for accessing a group of resources
served on a common endpoint with default values valid for all or
most of the calls you need to make. For your convenience,
some defaults are already provided.
To install request-session
, use pip:
pip install request-session
from request_session import RequestSession
client = RequestSession(
host="https://jobs.kiwi.com",
max_retries=4, # how many times to retry in case server error occurs
raise_for_status=True, # raise an exception if failed on every attempt
)
response = client.get(
path="/",
sleep_before_repeat=1, # how many seconds to wait untill next try
request_category="jobs", # what to log to stdout/stderr
)
RequestSession
stdout
.GET
, POST
, PUT
, PATCH
, and
DELETE
methods, several metrics are sent to your datadog client -
duration of the request, how many requests were sent,
outcome of the request (a DataDog integration is needed).RequestSession
can send tracing info to DataDog
(an APM integration is needed).You can find more details about RequestSession
's benefits and examples in
the official documentation.
To run all tests you just need to run the command tox
.
Note that tox doesn't know when you change the
requirements.txt
and won't automatically install new dependencies for test runs. Runpip install tox-battery
to install a plugin which fixes this silliness.
FAQs
Python HTTP requests on steroids
We found that request-session demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.