Skip to content

Build up request query parameters from URL client and request parameters#961

Closed
KeeganOP wants to merge 0 commit into
pydantic:mainfrom
KeeganOP:main
Closed

Build up request query parameters from URL client and request parameters#961
KeeganOP wants to merge 0 commit into
pydantic:mainfrom
KeeganOP:main

Conversation

@KeeganOP
Copy link
Copy Markdown

@KeeganOP KeeganOP commented May 17, 2026

Summary

Fixes #905 - Currently the URL params are extracted but never added to the request params. This PR uses those params as a base and merges the params specified on the client and request (in that order) and passes that as the final request params

Checklist

  • I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 17, 2026

Merging this PR will not alter performance

✅ 7 untouched benchmarks


Comparing KeeganOP:main (643ad3f) with main (8a903c6)

Open in CodSpeed

@mbeijen
Copy link
Copy Markdown
Contributor

mbeijen commented May 17, 2026

I think this should be fixed in init and not here - because this would still not work with your code:

httpx2.Request("GET", "http://example.com/?a=1", params={"b": "2"})

I fixed this in httpxyz like so:
https://codeberg.org/httpxyz/httpxyz/commit/417d6c6fa193c5f29cdacefef6a4f7c9e5d30313

@KeeganOP KeeganOP marked this pull request as draft May 18, 2026 15:38
@KeeganOP KeeganOP closed this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When the URL contains request parameters and the params parameter is set, the request parameters in the URL will disappear unexpectedly.

2 participants