Return an absolute URL, using this URL as the base. Eg. url = httpx.URL("https://www.example.com/test") url = url.join("/new/path") assert url == "https://www.example.com/new/path"
(self, url: URL | str)
| 352 | return self.copy_with(params=self.params.merge(params)) |
| 353 | |
| 354 | def join(self, url: URL | str) -> URL: |
| 355 | """ |
| 356 | Return an absolute URL, using this URL as the base. |
| 357 | |
| 358 | Eg. |
| 359 | |
| 360 | url = httpx.URL("https://www.example.com/test") |
| 361 | url = url.join("/new/path") |
| 362 | assert url == "https://www.example.com/new/path" |
| 363 | """ |
| 364 | from urllib.parse import urljoin |
| 365 | |
| 366 | return URL(urljoin(str(self), str(URL(url)))) |
| 367 | |
| 368 | def __hash__(self) -> int: |
| 369 | return hash(str(self)) |