Skip to main content
🔒 Preview mode. The first 15 Foundations lessons are free; this one is Pro. Start a 7-day trial to unlock the editor, AI hints and the rest of the curriculum. Card required, cancel any time in Dashboard.
Start 7-day trial →
⚡
← Courses
›
FastAPI Production
›
Module 1 · FastAPI Basics
›
Async, properly
quiz
4 / 105
🇺🇸
EN
▼
↗
Share
⋯
More
+75 XP
📋
Task
📖
Theory
🤖
AI Help
Task
Why is calling `requests.get(...)` inside an `async def` route harmful?
🎯 Quiz
Question
Why is calling `requests.get(...)` inside an `async def` route harmful?
A
Uvicorn raises `RuntimeError: blocking call in coroutine` and returns 500 to the caller before the request even reaches your handler
B
It blocks the entire event loop, stalling every concurrent request on the worker until the synchronous HTTP call returns
C
Pydantic refuses to serialize the `requests.Response` object and the route returns a 422 even when the upstream call succeeded
D
FastAPI silently wraps the call in a threadpool, paying double overhead for what should be a single awaited coroutine
Submit answer
💬 Discussion
Be the first to ask a question or share a tip.
Sign in
to join the discussion. Reading is free.
Loading discussion…