You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2.2 KiB

📨 💽

🕐 👆 💪 📨 📨 🏑 ↩️ 🎻, 👆 💪 ⚙️ Form.

!!! info ⚙️ 📨, 🥇 python-multipart.

🤶 Ⓜ. `pip install python-multipart`.

🗄 Form

🗄 Form ➡️ fastapi:

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

🔬 Form 🔢

📨 🔢 🎏 🌌 👆 🔜 Body ⚖️ Query:

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

🖼, 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`. 👆 🔜 ✍ 🔃 🚚 📁 ⏭ 📃.

🚥 👆 💚 ✍ 🌖 🔃 👉 🔢 &amp; 📨 🏑, 👳 <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST" class="external-link" target="_blank"><abbr title="Mozilla Developer Network">🏇</abbr> 🕸 🩺 <code>POST</code></a>.

!!! warning 👆 💪 📣 💗 Form 🔢 🛠️, 👆 💪 🚫 📣 Body 🏑 👈 👆 📨 🎻, 📨 🔜 ✔️ 💪 🗜 ⚙️ application/x-www-form-urlencoded ↩️ application/json.

👉 🚫 🚫 **FastAPI**, ⚫️ 🍕 🇺🇸🔍 🛠️.

🌃

⚙️ Form 📣 📨 💽 🔢 🔢.