將 Map 作為查詢字串或 postform 參數
POST /post?ids[a]=1234&ids[b]=hello HTTP/1.1Content-Type: application/x-www-form-urlencoded
names[first]=thinkerou&names[second]=tianou
import ( "fmt"
"github.com/gin-gonic/gin")
func main() { router := gin.Default()
router.POST("/post", func(c *gin.Context) {
ids := c.QueryMap("ids") names := c.PostFormMap("names")
fmt.Printf("ids: %v; names: %v", ids, names) }) router.Run(":8080")}
ids: map[b:hello a:1234], names: map[second:tianou first:thinkerou]