You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed a difference between httpx and requests when processing query parameters. I provided the params for the url with query string, requests would mergeparams into query string, but httpx replaces the whole query string.
On second thoughts, we should actually be handling that bit on the URL class itself.
(So that manually building a request with request = Request(url, params=params) has the right merge behavior too.)
The signature there is URL(url, params=None). When params are provided they remove any querystring on the url, and replace it with params. Instead we should merge any params argument with any query params that are present in the URL string.
Activity
lovelydinosaur commentedon Dec 20, 2019
Not intentional, nope.
It looks like we need to make sure the
merge_queryparamsalso accepts theurl, and includes any query params that are included there.https://github.com/encode/httpx/blob/master/httpx/client.py#L370-L381
lovelydinosaur commentedon Dec 20, 2019
On second thoughts, we should actually be handling that bit on the
URLclass itself.(So that manually building a request with
request = Request(url, params=params)has the right merge behavior too.)The signature there is
URL(url, params=None). Whenparamsare provided they remove any querystring on theurl, and replace it withparams. Instead we should merge anyparamsargument with any query params that are present in the URL string.Fix URL params to merge with existing query parameters instead of rep…