1.7 KiB
🌖 👔 📟
🔢, FastAPI 🔜 📨 📨 ⚙️ JSONResponse
, 🚮 🎚 👆 📨 ⚪️➡️ 👆 ➡ 🛠️ 🔘 👈 JSONResponse
.
⚫️ 🔜 ⚙️ 🔢 👔 📟 ⚖️ 1️⃣ 👆 ⚒ 👆 ➡ 🛠️.
🌖 👔 📟
🚥 👆 💚 📨 🌖 👔 📟 ↖️ ⚪️➡️ 👑 1️⃣, 👆 💪 👈 🛬 Response
🔗, 💖 JSONResponse
, & ⚒ 🌖 👔 📟 🔗.
🖼, ➡️ 💬 👈 👆 💚 ✔️ ➡ 🛠️ 👈 ✔ ℹ 🏬, & 📨 🇺🇸🔍 👔 📟 2️⃣0️⃣0️⃣ "👌" 🕐❔ 🏆.
✋️ 👆 💚 ⚫️ 🚫 🆕 🏬. & 🕐❔ 🏬 🚫 🔀 ⏭, ⚫️ ✍ 👫, & 📨 🇺🇸🔍 👔 📟 2️⃣0️⃣1️⃣ "✍".
🏆 👈, 🗄 JSONResponse
, & 📨 👆 🎚 📤 🔗, ⚒ status_code
👈 👆 💚:
{!../../docs_src/additional_status_codes/tutorial001.py!}
/// warning
🕐❔ 👆 📨 Response
🔗, 💖 🖼 🔛, ⚫️ 🔜 📨 🔗.
⚫️ 🏆 🚫 🎻 ⏮️ 🏷, ♒️.
⚒ 💭 ⚫️ ✔️ 📊 👆 💚 ⚫️ ✔️, & 👈 💲 ☑ 🎻 (🚥 👆 ⚙️ JSONResponse
).
///
/// note | "📡 ℹ"
👆 💪 ⚙️ from starlette.responses import JSONResponse
.
FastAPI 🚚 🎏 starlette.responses
fastapi.responses
🏪 👆, 👩💻. ✋️ 🌅 💪 📨 👟 🔗 ⚪️➡️ 💃. 🎏 ⏮️ status
.
///
🗄 & 🛠️ 🩺
🚥 👆 📨 🌖 👔 📟 & 📨 🔗, 👫 🏆 🚫 🔌 🗄 🔗 (🛠️ 🩺), ↩️ FastAPI 🚫 ✔️ 🌌 💭 ⏪ ⚫️❔ 👆 🚶 📨.
✋️ 👆 💪 📄 👈 👆 📟, ⚙️: 🌖 📨{.internal-link target=_blank}.