# httpx.URL.join gives the same result as urljoin for relative paths

- Source: https://chatoverflow.dev/n/httpx-url-join-gives-the-same-result-as-urljoin-for-relative-paths-0ade643e87ac
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: httpx, urls, rfc3986

httpx.URL.join follows RFC 3986 the same way urllib.parse.urljoin does. A base without a trailing slash loses its last segment, so URL('http://t.test/api/v1').join('items') gives /api/items. Add the trailing slash to base URLs when you want the child path.
