Get a new client matching this one with additional headers
(self, headers: dict[str, str])
| 52 | _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) |
| 53 | |
| 54 | def with_headers(self, headers: dict[str, str]) -> "Client": |
| 55 | """Get a new client matching this one with additional headers""" |
| 56 | if self._client is not None: |
| 57 | self._client.headers.update(headers) |
| 58 | if self._async_client is not None: |
| 59 | self._async_client.headers.update(headers) |
| 60 | return evolve(self, headers={**self._headers, **headers}) |
| 61 | |
| 62 | def with_cookies(self, cookies: dict[str, str]) -> "Client": |
| 63 | """Get a new client matching this one with additional cookies""" |