mirror of https://github.com/tiangolo/fastapi.git
42 lines
1.8 KiB
Markdown
42 lines
1.8 KiB
Markdown
# 📨 🎚
|
||
|
||
## ⚙️ `Response` 🔢
|
||
|
||
👆 💪 📣 🔢 🆎 `Response` 👆 *➡ 🛠️ 🔢* (👆 💪 🍪).
|
||
|
||
& ⤴️ 👆 💪 ⚒ 🎚 👈 *🔀* 📨 🎚.
|
||
|
||
{* ../../docs_src/response_headers/tutorial002.py hl[1,7:8] *}
|
||
|
||
& ⤴️ 👆 💪 📨 🙆 🎚 👆 💪, 👆 🛎 🔜 ( `dict`, 💽 🏷, ♒️).
|
||
|
||
& 🚥 👆 📣 `response_model`, ⚫️ 🔜 ⚙️ ⛽ & 🗜 🎚 👆 📨.
|
||
|
||
**FastAPI** 🔜 ⚙️ 👈 *🔀* 📨 ⚗ 🎚 (🍪 & 👔 📟), & 🔜 🚮 👫 🏁 📨 👈 🔌 💲 👆 📨, ⛽ 🙆 `response_model`.
|
||
|
||
👆 💪 📣 `Response` 🔢 🔗, & ⚒ 🎚 (& 🍪) 👫.
|
||
|
||
## 📨 `Response` 🔗
|
||
|
||
👆 💪 🚮 🎚 🕐❔ 👆 📨 `Response` 🔗.
|
||
|
||
✍ 📨 🔬 [📨 📨 🔗](response-directly.md){.internal-link target=_blank} & 🚶♀️ 🎚 🌖 🔢:
|
||
|
||
{* ../../docs_src/response_headers/tutorial001.py hl[10:12] *}
|
||
|
||
/// note | 📡 ℹ
|
||
|
||
👆 💪 ⚙️ `from starlette.responses import Response` ⚖️ `from starlette.responses import JSONResponse`.
|
||
|
||
**FastAPI** 🚚 🎏 `starlette.responses` `fastapi.responses` 🏪 👆, 👩💻. ✋️ 🌅 💪 📨 👟 🔗 ⚪️➡️ 💃.
|
||
|
||
& `Response` 💪 ⚙️ 🛎 ⚒ 🎚 & 🍪, **FastAPI** 🚚 ⚫️ `fastapi.Response`.
|
||
|
||
///
|
||
|
||
## 🛃 🎚
|
||
|
||
✔️ 🤯 👈 🛃 © 🎚 💪 🚮 <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers" class="external-link" target="_blank">⚙️ '✖-' 🔡</a>.
|
||
|
||
✋️ 🚥 👆 ✔️ 🛃 🎚 👈 👆 💚 👩💻 🖥 💪 👀, 👆 💪 🚮 👫 👆 ⚜ 📳 (✍ 🌅 [⚜ (✖️-🇨🇳 ℹ 🤝)](../tutorial/cors.md){.internal-link target=_blank}), ⚙️ 🔢 `expose_headers` 📄 <a href="https://www.starlette.dev/middleware/#corsmiddleware" class="external-link" target="_blank">💃 ⚜ 🩺</a>.
|