Closed
Description
Is Map as query parameter supported? And if it is how to use it? I tried with:
localhost:8080?test[asd]=asd&test[dsa]=dsa
and the code
queries := c.Request.URL.Query()
// Doesn't work
log.Println(queries["test"])
// Gets the variable but not how I want it.
log.Println(queries["test[asd]"][0])
Activity
picone commentedon Sep 12, 2017
You can try this
tsirolnik commentedon Oct 19, 2017
Was just about to post an issue regarding this subject
@picone GetQueryArray returns an array where @guzmo request is for a map, e.g -
Would fit for GetQueryArray
but
Would need a map as the result is the following map -
I couldn't find an existing solution for this in Gin
syssam commentedon May 20, 2018
Any one know this solution?
I also have this problem on Post Form
thinkerou commentedon Jun 6, 2018
@guzmo please see #1383 thanks!
appleboy commentedon Aug 6, 2018
Please try the latest version and see the document https://github.com/gin-gonic/gin#map-as-querystring-or-postform-parameters