Skip to content

Commit 8210bf1

Browse files
committed
chore: add changeset for per-request overrides feature
1 parent 8a642c4 commit 8210bf1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
default: minor
3+
---
4+
5+
# Add per-request headers, timeout, and auth overrides to endpoint functions
6+
7+
All generated endpoint functions (`sync_detailed`, `asyncio_detailed`, `sync`, `asyncio`) now accept three optional keyword arguments forwarded directly to the underlying httpx request:
8+
9+
- `headers: dict[str, str] | None = None` — extra headers merged on top of any spec-defined headers for this request
10+
- `timeout: httpx.Timeout | None | Unset = UNSET` — override the client-level timeout for this request; `None` disables the timeout
11+
- `auth: httpx.Auth | None | Unset = UNSET` — override the client-level auth for this request; `None` disables auth
12+
13+
This allows per-request customisation without creating a new client instance, preserving the shared httpx connection pool. Using `with_headers()` / `with_timeout()` at runtime was previously the only option, but those methods mutate the original client's underlying httpx client as a side effect and cause the returned client to open a new connection pool on first use—making them unsafe for concurrent async code.
14+
15+
Note: client-level headers cannot be fully removed for a single request via this mechanism, only overridden with a different value.

0 commit comments

Comments
 (0)