Synchronous requests.* call inside an async route handler
Part of Code Quality & Syntax, which counts for 20% of the overall score. When this check fires it deducts 8 points from that category, once per scan, no matter how many places it turns up.
What it detects
The synchronous requests library performs its own blocking socket I/O, so calling requests.get/post/put/patch/delete inside an async def handler blocks the event loop for the full round trip of that HTTP call.
Why it matters
The requests library opens a real socket and blocks the calling thread until the response arrives. Called inside an async def handler, that blocks the single event loop for the full round trip of the HTTP call, so a slow upstream API turns every concurrent request on that worker into a queue behind it.
How to fix it
Replace requests with an async HTTP client such as httpx.AsyncClient or aiohttp, and await the call. Reuse one client instance across requests (created at startup, closed at shutdown) rather than opening a new client per call, matching the connection-pooling behavior requests gives you for free.
The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing
Does your repo trip this check?
Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.
Scan your repo