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.

3.2 KiB

🎚 🔢

👆 💪 🔬 🎚 🔢 🎏 🌌 👆 🔬 Query, Path & Cookie 🔢.

🗄 Header

🥇 🗄 Header:

=== "🐍 3️⃣.6️⃣ & 🔛"

```Python hl_lines="3"
{!> ../../../docs_src/header_params/tutorial001.py!}
```

=== "🐍 3️⃣.1️⃣0️⃣ & 🔛"

```Python hl_lines="1"
{!> ../../../docs_src/header_params/tutorial001_py310.py!}
```

📣 Header 🔢

⤴️ 📣 🎚 🔢 ⚙️ 🎏 📊 ⏮️ Path, Query & Cookie.

🥇 💲 🔢 💲, 👆 💪 🚶‍♀️ 🌐 🔬 ⚖️🔢:

=== "🐍 3️⃣.6️⃣ & 🔛"

```Python hl_lines="9"
{!> ../../../docs_src/header_params/tutorial001.py!}
```

=== "🐍 3️⃣.1️⃣0️⃣ & 🔛"

```Python hl_lines="7"
{!> ../../../docs_src/header_params/tutorial001_py310.py!}
```

!!! note "📡 ℹ" Header "👭" 🎓 Path, Query & Cookie. 😖 ➡️ 🎏Param 🎓.

✋️ 💭 👈 🕐❔ 👆 🗄 `Query`, `Path`, `Header`, & 🎏 ⚪️➡️ `fastapi`, 👈 🤙 🔢 👈 📨 🎁 🎓.

!!! info 📣 🎚, 👆 💪 ⚙️ Header, ↩️ 🔢 🔜 🔬 🔢 🔢.

🏧 🛠️

Header ✔️ 🐥 🛠️ 🔛 🔝 Path, Query & Cookie 🚚.

🌅 🐩 🎚 🎏 "🔠" 🦹, 💭 " 🔣" (-).

🔢 💖 user-agent 🐍.

, 🔢, Header 🔜 🗜 🔢 📛 🦹 ➡️ 🎦 (_) 🔠 (-) ⚗ & 📄 🎚.

, 🇺🇸🔍 🎚 💼-😛,, 👆 💪 📣 👫 ⏮️ 🐩 🐍 👗 (💭 "🔡").

, 👆 💪 ⚙️ user_agent 👆 🛎 🔜 🐍 📟, ↩️ 💆‍♂ 🎯 🥇 🔤 User_Agent ⚖️ 🕳 🎏.

🚥 🤔 👆 💪 🏧 🛠️ 🎦 🔠, ⚒ 🔢 convert_underscores Header False:

=== "🐍 3️⃣.6️⃣ & 🔛"

```Python hl_lines="10"
{!> ../../../docs_src/header_params/tutorial002.py!}
```

=== "🐍 3️⃣.1️⃣0️⃣ & 🔛"

```Python hl_lines="8"
{!> ../../../docs_src/header_params/tutorial002_py310.py!}
```

!!! warning ⏭ ⚒ convert_underscores False, 🐻 🤯 👈 🇺🇸🔍 🗳 & 💽 / ⚙️ 🎚 ⏮️ 🎦.

🎚

💪 📨 🎚. 👈 ⛓, 🎏 🎚 ⏮️ 💗 💲.

👆 💪 🔬 👈 💼 ⚙️ 📇 🆎 📄.

👆 🔜 📨 🌐 💲 ➡️ 🎚 🐍 list.

🖼, 📣 🎚 X-Token 👈 💪 😑 🌅 🌘 🕐, 👆 💪 ✍:

=== "🐍 3️⃣.6️⃣ & 🔛"

```Python hl_lines="9"
{!> ../../../docs_src/header_params/tutorial003.py!}
```

=== "🐍 3️⃣.9️⃣ & 🔛"

```Python hl_lines="9"
{!> ../../../docs_src/header_params/tutorial003_py39.py!}
```

=== "🐍 3️⃣.1️⃣0️⃣ & 🔛"

```Python hl_lines="7"
{!> ../../../docs_src/header_params/tutorial003_py310.py!}
```

🚥 👆 🔗 ⏮️ 👈 🛠️ 📨 2️⃣ 🇺🇸🔍 🎚 💖:

X-Token: foo
X-Token: bar

📨 🔜 💖:

{
    "X-Token values": [
        "bar",
        "foo"
    ]
}

🌃

📣 🎚 ⏮️ Header, ⚙️ 🎏 Query, Path & Cookie.

& 🚫 😟 🔃 🎦 👆 🔢, FastAPI 🔜 💅 🏭 👫.