Copy this URL, returning a new URL with some components altered. Accepts the same set of parameters as the components that are made available via properties on the `URL` class. For example: url = httpx.URL("https://www.example.com").copy_with( u
(self, **kwargs: typing.Any)
| 325 | return not self.is_absolute_url |
| 326 | |
| 327 | def copy_with(self, **kwargs: typing.Any) -> URL: |
| 328 | class="st">""" |
| 329 | Copy this URL, returning a new URL with some components altered. |
| 330 | Accepts the same set of parameters as the components that are made |
| 331 | available via properties on the `URL` class. |
| 332 | |
| 333 | For example: |
| 334 | |
| 335 | url = httpx.URL(class="st">"https://www.example.com").copy_with( |
| 336 | username=class="st">"jo@gmail.com", password=class="st">"a secret" |
| 337 | ) |
| 338 | assert url == class="st">"https://jo%40email.com:a%20secret@www.example.com" |
| 339 | class="st">""" |
| 340 | return URL(self, **kwargs) |
| 341 | |
| 342 | def copy_set_param(self, key: str, value: typing.Any = None) -> URL: |
| 343 | return self.copy_with(params=self.params.set(key, value)) |