⚙️ 📨 🔗¶
🆙 🔜, 👆 ✔️ 📣 🍕 📨 👈 👆 💪 ⏮️ 👫 🆎.
✊ 📊 ⚪️➡️:
- ➡ 🔢.
- 🎚.
- 🍪.
- ♒️.
& 🔨, FastAPI ⚖ 👈 💽, 🏭 ⚫️ & 🏭 🧾 👆 🛠️ 🔁.
✋️ 📤 ⚠ 🌐❔ 👆 💪 💪 🔐 Request
🎚 🔗.
ℹ 🔃 Request
🎚¶
FastAPI 🤙 💃 🔘, ⏮️ 🧽 📚 🧰 🔛 🔝, 👆 💪 ⚙️ 💃 Request
🎚 🔗 🕐❔ 👆 💪.
⚫️ 🔜 ⛓ 👈 🚥 👆 🤚 📊 ⚪️➡️ Request
🎚 🔗 (🖼, ✍ 💪) ⚫️ 🏆 🚫 ✔, 🗜 ⚖️ 📄 (⏮️ 🗄, 🏧 🛠️ 👩💻 🔢) FastAPI.
👐 🙆 🎏 🔢 📣 🛎 (🖼, 💪 ⏮️ Pydantic 🏷) 🔜 ✔, 🗜, ✍, ♒️.
✋️ 📤 🎯 💼 🌐❔ ⚫️ ⚠ 🤚 Request
🎚.
⚙️ Request
🎚 🔗¶
➡️ 🌈 👆 💚 🤚 👩💻 📢 📢/🦠 🔘 👆 ➡ 🛠️ 🔢.
👈 👆 💪 🔐 📨 🔗.
from fastapi import FastAPI, Request
app = FastAPI()
@app.get("/items/{item_id}")
def read_root(item_id: str, request: Request):
client_host = request.client.host
return {"client_host": client_host, "item_id": item_id}
📣 ➡ 🛠️ 🔢 🔢 ⏮️ 🆎 ➖ Request
FastAPI 🔜 💭 🚶♀️ Request
👈 🔢.
Tip
🗒 👈 👉 💼, 👥 📣 ➡ 🔢 ⤴️ 📨 🔢.
, ➡ 🔢 🔜 ⚗, ✔, 🗜 ✔ 🆎 & ✍ ⏮️ 🗄.
🎏 🌌, 👆 💪 📣 🙆 🎏 🔢 🛎, & ➡, 🤚 Request
💁♂️.
Request
🧾¶
👆 💪 ✍ 🌅 ℹ 🔃 Request
🎚 🛂 💃 🧾 🕸.
📡 ℹ
👆 💪 ⚙️ from starlette.requests import Request
.
FastAPI 🚚 ⚫️ 🔗 🏪 👆, 👩💻. ✋️ ⚫️ 👟 🔗 ⚪️➡️ 💃.