Skip to content
poteto edited this page Oct 27, 2024 · 1 revision

Body Paramter

You can Bind to the Model by body Parameter

Bind

Request as below

{
  "name":"test"
  "mail":"[email protected]"
}

You can bind

type User struct {
  Name string `json:"name"`
  Mail string `json:"mail"`
}

func BindUser(ctx poteto.Context) {
  user := User{}
  ctx.Bind(&user)
}
Clone this wiki locally