请求的主体被解码为我自己的 go 结构。
// The go struct.
type NewUser struct {
User string `json:"user" validate:"required"`
Password string `json:"password" validate:"required"`
PasswordConfirm string `json:"password_confirm" validate:"eqfield=Password"`
}
---
// the web request with body will be decoded into this struct.
var nu NewUser
if err := web.Decode(r, &nu); err != nil {
return errors.Wrap(err, "")
}
我应该如何将这个 body 传递给 postman 。
最佳答案
关于go - 在 Postman 中填写请求正文,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60227703/