1.8 KiB
📨 🍪
⚙️ Response
🔢
👆 💪 📣 🔢 🆎 Response
👆 ➡ 🛠️ 🔢.
& ⤴️ 👆 💪 ⚒ 🍪 👈 🔀 📨 🎚.
{!../../docs_src/response_cookies/tutorial002.py!}
& ⤴️ 👆 💪 📨 🙆 🎚 👆 💪, 👆 🛎 🔜 ( dict
, 💽 🏷, ♒️).
& 🚥 👆 📣 response_model
, ⚫️ 🔜 ⚙️ ⛽ & 🗜 🎚 👆 📨.
FastAPI 🔜 ⚙️ 👈 🔀 📨 ⚗ 🍪 (🎚 & 👔 📟), & 🔜 🚮 👫 🏁 📨 👈 🔌 💲 👆 📨, ⛽ 🙆 response_model
.
👆 💪 📣 Response
🔢 🔗, & ⚒ 🍪 (& 🎚) 👫.
📨 Response
🔗
👆 💪 ✍ 🍪 🕐❔ 🛬 Response
🔗 👆 📟.
👈, 👆 💪 ✍ 📨 🔬 📨 📨 🔗{.internal-link target=_blank}.
⤴️ ⚒ 🍪 ⚫️, & ⤴️ 📨 ⚫️:
{!../../docs_src/response_cookies/tutorial001.py!}
/// tip
✔️ 🤯 👈 🚥 👆 📨 📨 🔗 ↩️ ⚙️ Response
🔢, FastAPI 🔜 📨 ⚫️ 🔗.
, 👆 🔜 ✔️ ⚒ 💭 👆 💽 ☑ 🆎. 🤶 Ⓜ. ⚫️ 🔗 ⏮️ 🎻, 🚥 👆 🛬 JSONResponse
.
& 👈 👆 🚫 📨 🙆 📊 👈 🔜 ✔️ ⛽ response_model
.
///
🌅 ℹ
/// note | 📡 ℹ
👆 💪 ⚙️ from starlette.responses import Response
⚖️ from starlette.responses import JSONResponse
.
FastAPI 🚚 🎏 starlette.responses
fastapi.responses
🏪 👆, 👩💻. ✋️ 🌅 💪 📨 👟 🔗 ⚪️➡️ 💃.
& Response
💪 ⚙️ 🛎 ⚒ 🎚 & 🍪, FastAPI 🚚 ⚫️ fastapi.Response
.
///
👀 🌐 💪 🔢 & 🎛, ✅ 🧾 💃.