How could I send an array of list as query parameters via POST method?
See original GitHub issueI have to send a list or array as parameters with POST method, like this:
@app.post('endpoint')
async def feedback(feed: List[int])
I expect to be able to send parameters of a list of integer, and return the response.
However, in the UI document, the endpoint couldn’t receive request parameters, instead only showing return 0.
I’d looked for request body, and tried to do something like this:
class Item(BaseModel):
feedback: int
async def feedback(feed: List[Item])
But that returns this: feedback: 0
and I still could not send parameters of a list.
How could I fulfill this task?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Spring — Passing list and array of values as URL parameters
Let's see how to send a list of query parameters, and receive them in array/arraylist in Spring. Sending via URL: List of values...
Read more >Pass array as query parameter in Postman - Stack Overflow
I am calling DELETE method to delete a user from list of databases. It is expecting list of database names as array in...
Read more >Send Array List through Query Parameters on HTTP Request ...
I am sending array list of Query params through HTTP request Array list id's [1234,3442,9489,9498] · <http:request method="GET" doc:name="Request" doc:id=" ...
Read more >Pass an array as a parameter | Postman Answers
Parse a variable to use as an array; Loop through an array and use the sendRequest method to send a request directly from...
Read more >Angular - How to pass arrays via Query Parameters
How to pass an array of values via query parameter in Angular. Tagged with angular, angular11, queryparam, queryparameters.
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
Thanks for the help here @hard-coders ! 👏 🙇
Thanks for reporting back and closing the issue @laurence-lin 👍
I understand, I may have to create an JSON file containing the list of values, and attach in the request body. Thank you!