[TOC]
- Query and post form parameters
Query and post form parameters
POST /post?id=a&id=b&id=c&name=john&name=doe&name=katarasContent-Type: application/x-www-form-urlencoded
func main() { app := iris.Default() app.Post("/post", func(ctx iris.Context) { ids := ctx.URLParamSlice("id") names, err := ctx.PostValues("name") if err != nil { ctx.StopWithError(iris.StatusBadRequest, err) return } ctx.Writef("ids: %v; names: %v", ids, names) }) app.Listen(":8080")}
ids: [a b c], names: [john doe kataras]
