Files
fastapi/docs/em/docs/tutorial/middleware.md
LeeeeT d4e85da18b 🌐 🔠 📄 🐢 Translate docs to Emoji 🥳 🎉 💥 🤯 🤯 (#5385)
* 🌐 💬  🩺  🦲

* 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks

* 🛠️😊

* ♻️ Rename emoji lang from emj to em, and main docs name as 😉

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Axd1x8a <26704473+FeeeeK@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-04-01 11:26:04 +02:00

2.4 KiB
Raw Blame History

🛠️

👆 💪 🚮 🛠️ FastAPI 🈸.

"🛠️" 🔢 👈 👷 ⏮️ 🔠 📨 🛠️ 🙆 🎯 🛠️. & ⏮️ 🔠 📨🛬 .

  • 🔠 📨 👈 👟 👆 🈸.
  • 💪 ⤴️ 🕳 👈 📨 ⚖️ 🏃 🙆 💪 📟.
  • ⤴️ 🚶‍♀️ 📨 🛠️ 🎂 🈸 ( 🛠️).
  • ⤴️ 📨 🏗 🈸 ( 🛠️).
  • 💪 🕳 👈 📨 ⚖️ 🏃 🙆 💪 📟.
  • ⤴️ 📨 📨.

!!! note "📡 " 🚥 👆 ✔️ 🔗 ⏮️ yield, 🚪 📟 🔜 🏃 ⏮️ 🛠️.

🚥 📤 🙆 🖥 📋 (📄 ⏪), 👫 🔜 🏃 *⏮️* 🌐 🛠️.

🛠️

🛠️ 👆 ⚙️ 👨‍🎨 @app.middleware("http") 🔛 🔝 🔢.

🛠️ 🔢 📨:

  • request.
  • 🔢 call_next 👈 🔜 📨 request 🔢.
    • 👉 🔢 🔜 🚶‍♀️ request 🔗 🛠️.
    • ⤴️ 📨 response 🏗 🔗 🛠️.
  • 👆 💪 ⤴️ 🔀 🌅 response🛬 .
{!../../../docs_src/middleware/tutorial001.py!}

!!! tip ✔️ 🤯 👈 🛃 © 🎚 💪 🚮 ⚙️ '✖-' 🔡.

✋️ 🚥 👆 ✔️ 🛃 🎚 👈 👆 💚 👩‍💻 🖥 💪 👀, 👆 💪 🚮 👫 👆 ⚜ 📳 ([⚜ (✖️-🇨🇳  🤝)](cors.md){.internal-link target=_blank}) ⚙️ 🔢 `expose_headers` 📄 <a href="https://www.starlette.io/middleware/#corsmiddleware" class="external-link" target="_blank">💃 ⚜ 🩺</a>.

!!! note "📡 " 👆 💪 ⚙️ from starlette.requests import Request.

**FastAPI** 🚚 ⚫️ 🏪 👆, 👩‍💻. ✋️ ⚫️ 👟 🔗 ⚪️➡️ 💃.

⏭ & ⏮️ response

👆 💪 🚮 📟 🏃 ⏮️ request, ⏭ 🙆 🛠️ 📨 .

& ⏮️ response 🏗, ⏭ 🛬 .

🖼, 👆 💪 🚮 🛃 🎚 X-Process-Time ⚗ 🕰 🥈 👈 🛠️ 📨 & 🏗 📨:

{!../../../docs_src/middleware/tutorial001.py!}

🎏 🛠️

👆 💪 🌖 🔃 🎏 🛠️ 🏧 👩‍💻 🦮: 🏧 🛠️{.internal-link target=_blank}.

👆 🔜🔃 🍵 ⏮️ 🛠️📄.