Browse by Topic

Popular

Latest

Latest Python Posts

Python requests library configuration for proxy, SSL, and User-Agent
Python

Python Requests Proxy SSL Verification and User Agent

Configure Python requests with a proxy, control SSL verification, and set a custom User-Agent header, including how to handle common SSL errors.

requestsproxySSL verificationUser-Agent
Diagram of a Python requests session managing multiple HTTP connections and cookies, with arrows showing reused connections and cookie persistence.
Python

Python requests.Session: Cookies and Connection Pooling

Learn how Python's requests.Session persists cookies and reuses TCP connections across requests: cookie handling, connection pooling internals, pool configuration, and common pitfalls.

requestssessioncookiesconnection pooling
Illustration of a client retrying a network request with exponential backoff, showing arrows of increasing length between two server nodes.
Python

Python Requests Retries: Exponential Backoff and Connection Errors

Configure retries in Python requests with exponential backoff to handle connection errors, transient HTTP failures, and timeouts.

pythonrequestsretryexponential-backoff
Illustration of a Python requests call with a timeout clock and an HTTP status error indicator
Python

Python Requests Timeout Exception Handling and raise_for_status

Set connect and read timeouts in Python requests, catch Timeout exceptions, and use raise_for_status() to handle HTTP error statuses. Includes retry and logging examples.

pythonrequeststimeoutexception-handling
Illustration of a Python requests response object showing a status code badge, a headers panel, and a JSON document.
Python

Python Requests: Reading Response Text, JSON, Headers, and Status Codes

Learn how to use Python requests to read response text, parse JSON, inspect headers, and handle status codes.

requestsHTTPJSONAPI
Illustration of Python requests authentication methods including bearer token, API key, and basic auth.
Python

Python Requests Authentication: Bearer Token, API Key, and Basic Auth

Learn how to authenticate Python requests calls using basic auth, bearer tokens, and API keys. Includes practical code examples, error handling, and security considerations.

pythonrequestsauthenticationbearer-token
Illustration of a Python HTTP request with query parameters, headers, and JSON body components.
Python

Python Requests: Query Parameters, Headers, and JSON Body

Learn how to send query parameters, custom headers, and JSON bodies with Python requests, including how to combine them in one request and avoid common API client mistakes.

python-requestshttp-requestsjson-bodyquery-parameters
Illustration showing the Python requests library handling five HTTP methods with a request and response data flow.
Python

Python Requests: GET, POST, PUT, PATCH, DELETE

Use the Python requests library for GET, POST, PUT, PATCH, and DELETE HTTP methods, including JSON and form data, timeouts, sessions, and retry policies.

requestshttp-methodsrest-apiapi-integration
Diagram comparing contextvars and thread-local storage in Python, showing context propagation across async tasks and threads.
Python

Python contextvars vs Thread Local: Which to Use?

Compare Python's contextvars and thread-local storage for passing context across threads and async tasks. Understand propagation, isolation, and when each fits.

contextvarsthread-localasyncconcurrency
A visual comparison of Python coroutines and futures, showing how they interact in asyncio.
Python

Python Coroutine vs Future: Key Differences

python coroutine vs future: Understand the difference between Python coroutines and futures, how they work together in asyncio, and when to use each for efficient asyn...

asyncioconcurrencycoroutinesfutures