# HTTPX Query Parameter Merge — Lattice case study

> One valid feature: URLs can contain query parameters. Another valid feature: requests can pass `params=`. Together, affected HTTPX versions dropped the original URL query parameters.

## Example

```python
import httpx

request = httpx.Request(
    "GET",
    "https://example.com/path?page=1&s=list",
    params={"pid": 0},
)

print(request.url)
```

**Observed:**

```
https://example.com/path?pid=0
```

**Compatibility baseline (requests library):**

```
https://example.com/path?page=1&s=list&pid=0
```

## Upstream context

This case study intentionally points to the upstream [issue](https://github.com/encode/httpx/issues/3621) and [PR](https://github.com/encode/httpx/pull/3761). Lattice is not claiming authorship of the bug; it provides a compact way to model the surrounding interaction surface.

## Lattice model

```
entrypoint:    [request_object, client_build_request]
method:        [GET, POST]
path_shape:    [root_path, nested_path]
url_query:     [absent, single, multi]
params_arg:    [absent, single, multi, overlapping_key]
params_shape:  [dict, list_tuples]
```

`params_shape` is conditional on `params_arg` being present.

## Result

- The schema product has 288 raw parameter combinations before constraints.
- Lattice generated 12 pairwise scenarios.
- The probe produced 6 mismatches against `requests` for `httpx==0.28.1`.

## Repo links

- [docs/case-studies.md](https://github.com/tylerklose/lattice/blob/main/docs/case-studies.md)
- [examples/httpx-query-param-merge](https://github.com/tylerklose/lattice/tree/main/examples/httpx-query-param-merge)
- [model.yaml](https://github.com/tylerklose/lattice/blob/main/examples/httpx-query-param-merge/model.yaml)
- [scenarios.json](https://github.com/tylerklose/lattice/blob/main/examples/httpx-query-param-merge/scenarios.json)
- [run_probe.py](https://github.com/tylerklose/lattice/blob/main/examples/httpx-query-param-merge/run_probe.py)

---

This is the kind of bug pairwise testing is good at: not invalid input, not a single broken feature, but two valid features composing into wrong output.

---

This is a plain-text mirror of <https://tylerklose.com/lattice/httpx-query-param-merge> for LLMs and agents. The [Lattice page](https://tylerklose.com/lattice) is the parent.

