1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-19 02:47:04 +00:00

add a simple URLParamSlice

I would love to change the current URLParams() to URLParams(name string) []string to match the PostValues(name string) []string, error but that would be a big breaking changes to many servers... so stick with it.
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-08-31 05:07:55 +03:00
parent 5f0a43cbc0
commit d0a27d2c08
4 changed files with 56 additions and 11 deletions

View File

@@ -25,6 +25,12 @@ func main() {
ctx.Writef("MyType: %#v", t)
})
app.Get("/simple", func(ctx iris.Context) {
names := ctx.URLParamSlice("name")
ctx.Writef("names: %v", ids)
})
// http://localhost:8080?name=iris&age=3
// http://localhost:8080/simple?name=john&name=doe&name=kataras
app.Listen(":8080")
}