go - 在 Postman 中填写请求正文

标签 go postman

请求的主体被解码为我自己的 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 。

最佳答案

您的问题不符合 StackOverflow 规则。

这是基本缺乏桌面用户体验。

screen

关于go - 在 Postman 中填写请求正文,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60227703/

相关文章:

Golang exec.Command() 错误 - 通过 golang 的 ffmpeg 命令

go - nsq go 客户端跟不上

gometalinter 正在检查/usr/local/go 文件

rest - 如何在 Postman 中一次更改多个 URL?

json - 如何在 Postman 中随机化 ENUM 输入?

rest - 领英 v2 API : How can upload an image using ugcPosts API?

azure - 使用POSTMAN获取授权码-OAuth2.0

go - 我可以同时添加到 map[] 值吗?

postman - 在 postman 中导出所有集合

go - 运行Go exec.Command()的Visual Studio Code在“kubectl版本”中超时