requests
Python HTTP for Humans
Python's built-in urllib is painfully verbose โ you need dozens of lines just to make a POST request with headers and parse the response. Before requests, every team wrote their own wrapper or copied boilerplate. Kenneth Reitz published requests in 2011 and the community never looked back.
Think of requests as a polished envelope system for HTTP: you stuff your data in, address it with a URL and headers, send it, and get a clean Response object back. The library handles encoding, redirects, cookies, and keep-alive connections so you don't have to.
Install requests
pip install requests
import requestsUse it when
Use requests for any synchronous HTTP work: calling REST APIs, scraping web pages, downloading files, or integrating with webhooks. It's the right default for scripts, CLI tools, and Django/Flask backends that don't need async.
Skip it when
Avoid requests when you're writing async code โ it will block your event loop. Switch to httpx (drop-in async API) or aiohttp for FastAPI backends, async scrapers, or anything running inside asyncio.
Ready to explore the full API?
See every class, function, and relationship in an interactive graph.