-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Provide an alternative to Uri#queryParameters which returns the values as a list #2645
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
Comments
Added Area-Library, Triaged labels. |
This comment was originally written by @seaneagan I would suggest: final Map<String, String> query; |
This comment was originally written by [email protected] Note that you can have more params of the same name in the query. It's the same case as HTTP headers -- when we get a [List]MultiMap, we should use that, until then, Map<String, List<String>>. |
This comment was originally written by @MarkBennett I agree that this will need MultiMap support or something similair in the future. Another option would be to collect multiple values into a List under the same key in the Map. I'll take a look at how other frameworks handle this for comparison. |
This comment was originally written by [email protected] For things like OpenSearch patterns I think you would also need to test for multiple and empty query terms. Like in: foo.org?qt1=p1,p2,p3&qt2=&qt3=p4 |
Sounds reasonable and something which can safely be added later. Added this to the Later milestone. |
We've seen a lot of code out there to parse query strings for Uri and Window.location. Since query strings are rarely useful without parsing, it'd be nice to get this solved sooner. Rather than waiting on MultiMap, we can handle this like HttpHeaders and use [] to get the list of values and value() to get a single value. Pete has a patch to add add query parsing to Location, but we're thinking it'd be much better on Uri, with a asUri() method on Location. cc @blois. |
Marked this as blocking #6679. |
cc @sgjesse. |
A Uri instance now has the getter queryParameters. It is a Map<String, String> and there is only one value for each name. |
Changed the title to: "Make Uri#queryParameters return a MultiMap". |
Removed Library-Uri label. |
We cannot change the type of queryParamaters now, but we could imagine another member on Uri which provides access to individual values as a list. Changed the title to: "Provide an alternative to Uri#queryParameters which returns the values as a list". |
Removed this from the Later milestone. |
Removed Oldschool-Milestone-Later label. |
Now also has |
This issue was originally filed by @MarkBennett
What steps will reproduce the problem?
What is the expected output? What do you see instead?
I expected to be able to call uri.params to access a Map of the params. This would also safely escape parameters, etc.
What version of the product are you using? On what operating system?
Version 0.1.0.201204121423, Build 6479
Dart SDK version 6478, Dartium version
Please provide any additional information below.
This issue arose as the result of a forum post...
https://groups.google.com/a/dartlang.org/group/misc/browse_thread/thread/b4f94de2bb6456cb#
The text was updated successfully, but these errors were encountered: