We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Demo
package main import "github.com/kataras/iris/v12" type Person struct { Name string `url:"name,required"` Address string `url:"address"` } func main() { app := iris.Default() app.Any("/", index) app.Listen(":8080") } func index(ctx iris.Context) { var person Person if err := ctx.ReadQuery(&person); err!=nil { ctx.StopWithError(iris.StatusBadRequest, err) return } ctx.Application().Logger().Infof("Person: %#+v", person) ctx.WriteString("Success") }
The reuqest url name is empty. but it tag is required. use ctx.ReadQuery(&person) not return err. validation is not effective ?
name
required
ctx.ReadQuery(&person)
The text was updated successfully, but these errors were encountered:
kataras
No branches or pull requests
Demo
The reuqest url
name
is empty. but it tag isrequired
. usectx.ReadQuery(&person)
not return err. validation is not effective ?The text was updated successfully, but these errors were encountered: