[QUESTION] List parameters in query string format
See original GitHub issueDescription
Currently, only format with plain parameter name is supported when passing list of parameters https://fastapi.tiangolo.com/tutorial/query-params-str-validations/#query-parameter-list-multiple-values and only q=1&q=2&q=3
format is supported, however passing list parameters using indexed or not indexed square brackets is widely used across the web and web APIs. None of this is, unfortunately a standard defined in any RFC.
There are 3 most common ways of passing lists out there:
q=1&q=2&q=3
q[]=1&q[]=2&q[]=3
q[0]=1&q[1]=2&q[2]=3
Some sdks, or clients for making requests by default send list using square brackets so there are some issues with configuration quite often.
Are there any plans to support square brackets for list parameters along with the current format?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
REST API Design Best Practices for Parameter and Query ...
There are many ways in HTTP to add parameters to our request: the query string, the body of POST, PUT and PATCH requests,...
Read more >How to pass an array within a query string? - Stack Overflow
Here's what I figured out: Submitting multi-value form fields, i.e. submitting arrays through GET/POST vars, can be done several different ...
Read more >Query string - Wikipedia
A query string is a part of a uniform resource locator (URL) that assigns values to specified parameters. A query string commonly includes...
Read more >Passing Information via Query Strings - Qualtrics
Let's take a look at an example URL with a query string appended to it. The query string is in bold. https://survey.qualtrics.com/jfe/form/SID=SV_1234?
Read more >A Beginner's Guide to URL Parameters - SEMrush
URL parameters (known also as “query strings” or “URL query parameters”) are elements inserted in your URLs to help you filter and organize ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is what I ended up putting in my app:
from fastapi.datastructures import QueryParams
orfrom starlette.datastructures import QueryParams