2.1 KiB
📨 💽
🕐❔ 👆 💪 📨 📨 🏑 ↩️ 🎻, 👆 💪 ⚙️ Form.
/// info
⚙️ 📨, 🥇 ❎ python-multipart.
🤶 Ⓜ. pip install python-multipart.
///
🗄 Form
🗄 Form ⚪️➡️ fastapi:
{* ../../docs_src/request_forms/tutorial001.py hl[1] *}
🔬 Form 🔢
✍ 📨 🔢 🎏 🌌 👆 🔜 Body ⚖️ Query:
{* ../../docs_src/request_forms/tutorial001.py hl[7] *}
🖼, 1️⃣ 🌌 Oauth2️⃣ 🔧 💪 ⚙️ (🤙 "🔐 💧") ⚫️ ✔ 📨 username & password 📨 🏑.
🔌 🚚 🏑 ⚫️❔ 📛 username & password, & 📨 📨 🏑, 🚫 🎻.
⏮️ Form 👆 💪 📣 🎏 📳 ⏮️ Body (& Query, Path, Cookie), 🔌 🔬, 🖼, 📛 (✅ user-name ↩️ username), ♒️.
/// info
Form 🎓 👈 😖 🔗 ⚪️➡️ Body.
///
/// tip
📣 📨 💪, 👆 💪 ⚙️ Form 🎯, ↩️ 🍵 ⚫️ 🔢 🔜 🔬 🔢 🔢 ⚖️ 💪 (🎻) 🔢.
///
🔃 "📨 🏑"
🌌 🕸 📨 (<form></form>) 📨 💽 💽 🛎 ⚙️ "🎁" 🔢 👈 📊, ⚫️ 🎏 ⚪️➡️ 🎻.
FastAPI 🔜 ⚒ 💭 ✍ 👈 📊 ⚪️➡️ ▶️️ 🥉 ↩️ 🎻.
/// note | 📡 ℹ
📊 ⚪️➡️ 📨 🛎 🗜 ⚙️ "📻 🆎" application/x-www-form-urlencoded.
✋️ 🕐❔ 📨 🔌 📁, ⚫️ 🗜 multipart/form-data. 👆 🔜 ✍ 🔃 🚚 📁 ⏭ 📃.
🚥 👆 💚 ✍ 🌖 🔃 👉 🔢 & 📨 🏑, 👳 🏇 🕸 🩺 POST.
///
/// warning
👆 💪 📣 💗 Form 🔢 ➡ 🛠️, ✋️ 👆 💪 🚫 📣 Body 🏑 👈 👆 ⌛ 📨 🎻, 📨 🔜 ✔️ 💪 🗜 ⚙️ application/x-www-form-urlencoded ↩️ application/json.
👉 🚫 🚫 FastAPI, ⚫️ 🍕 🇺🇸🔍 🛠️.
///
🌃
⚙️ Form 📣 📨 💽 🔢 🔢.