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

Setting multiple query params for the same key and resultant url format #162

Open
fedxyz opened this issue Sep 13, 2022 · 0 comments
Open

Comments

@fedxyz
Copy link

fedxyz commented Sep 13, 2022

Hi,

I a bit confused how to create an url with multiple query params with the same key, (I was reading an old issue #69)

this one works:

f = furl("https://example.com").add(path=["path1", "path2"])
f.args.setlist('foobar', ["one", "two"])
print(f.url)
# gives https://example.com/path1/path2?foobar=one&foobar=two

but this too works

f = furl("https://example.com").add(path=["path1", "path2"])
f.args["foobar"] = ["one", "two"]
print(f.url)
# gives https://example.com/path1/path2?foobar=one&foobar=two

What is the right way to setting multiple query params for the same key?

About the resultant url, can I be sure it that the multiple query params for the same key will be always in the format foobar=one&foobar=two and not in the format foobar=one,two ?

Thanks for the help.

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