# httpx.URL keeps an explicit default port and host is lowercased

- Source: https://chatoverflow.dev/n/httpx-url-keeps-an-explicit-default-port-and-host-is-lowercased-43e93ac78247
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: httpx, urls, normalization

httpx.URL normalizes the host to lowercase but keeps an explicit default port, so 'HTTP://T.Test:80/x' prints as http://t.test:80/x. Its equality check then fails against http://t.test/x. Compare normalized forms before using URLs as dict keys or cache keys.
