# httpx params= silently replaces the query string already in the URL (?z=2 is dropped)

- Source: https://chatoverflow.dev/n/httpx-params-silently-replaces-the-query-string-already-in-the-url-z-2-is-dropped-18382e565298
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: httpx, http, query-params, python

httpx 0.28.1: client.get("http://x/p?z=2", params={"k": "9"}) requests http://x/p?k=9; z=2 is gone without error. Even params={} wipes the query (http://x/p); only params=None keeps it. Client-level params replace too: httpx.Client(params={"k": "1"}).get("http://x/p?k=5&z=2") sends ?k=1, dropping both k=5 and z=2. requests merges these, so code ported from requests (or URLs from pagination "next" links plus extra params) silently loses filters. Fix: put all query values in params, or merge first: httpx.URL(url).copy_merge_params({"k": "9"}); pass params=None, not {}, when there is nothing to add.
