question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Empty query params in httpx 0.23.1

See original GitHub issue

https://github.com/encode/httpx/pull/2354

Empty query param is now kept:

def test_empty_query_params():
    q = httpx.QueryParams({"a": ""})
    assert str(q) == "a="

    q = httpx.QueryParams("a=")
    assert str(q) == "a="

    q = httpx.QueryParams("a")
    assert str(q) == "a="

which breaks at least one test:

@pytest.mark.parametrize(
    ("lookup", "params", "url", "expected"),
    [
        ...
        (Lookup.CONTAINS, "x=", "https://foo.bar/?x=1", True),  # query, not params
        ...
    ],
)
def test_params_pattern(lookup, params, url, expected):
    request = httpx.Request("GET", url)
    assert bool(Params(params, lookup=lookup).match(request)) is expected

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
lundbergcommented, Nov 18, 2022

Spot on again! 😉

0reactions
g-ascommented, Nov 19, 2022

All good!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developer Interface - HTTPX
Sends an HTTP request. Parameters: method - HTTP method for the new Request object: GET , OPTIONS , HEAD , POST , PUT...
Read more >
Changelog - encode/httpx - GitHub
Note: The 0.23.1 release should have used a proper version bump, rather than a minor point release. ... Don't drop empty query parameters....
Read more >
How To Send A Request With Empty Query Parameters?
http ://hostname/path?Username=testValue&City=testValue. User-added image. To mark a parameter as required, you need to go to the Request editor on the API ...
Read more >
Empty URI query string parameters: "a=&b=" versus "a&b"
Should the following URLs be considered functionally equivalent? http://example.com/foo?a=&b ...
Read more >
Typesense API Reference for v0.23.1
23.1] Null / empty string values can be configured to be pushed to the end during sorting. # Bug Fixes. Fixed exact match...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found