Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a method to set an individual query parameter without removing the rest or keeping the original value #168

Open
DetachHead opened this issue Nov 7, 2022 · 0 comments

Comments

@DetachHead
Copy link

from furl import furl


def url() -> furl:
    return furl("http://foo.com/?a=1&b=2")


print(url().set({"a": 3}))  # http://foo.com/?a=3
print(url().add({"a": 3}))  # http://foo.com/?a=1&b=2&a=3

# i would like to be able do this in one method:
print(url().remove(["a"]).add({"a": 3}))  # http://foo.com/?b=2&a=3

the current behavior of add where it supports multiple query params with the same value seems like an edge case imo

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

No branches or pull requests

1 participant