Hello sorry for noob question, I'd like to ask abo...
# ktor
Hello sorry for noob question, I'd like to ask about how could I get query parameters in array for example I have this endpoint, I want to get books that have genre romance or comedy from this route http://localhost:3001/books?genre=romance&genre=comedy I'm using this code
Copy code
val genre = call.request.queryParameters["genre"]
but only return the first genre which is
I don't have a answer to your question, but why do you use the query parameter multiple times? You could define it as commar separated list: http://localhost:3001/books?genre=romance,comedy This would be easy to use and is used in most publicly available websites.
You should use array notation, genre[]=romance&genre[]=comedy
Copy code
val genres = call.request.queryParameters.getAll("genre")
­čĹŹ 1
oh nice, thank you