登录
首页 >  Golang >  Go问答

在Postman中填写请求正文

来源:stackoverflow

时间:2024-04-01 17:36:29 128浏览 收藏

在Golang实战开发的过程中,我们经常会遇到一些这样那样的问题,然后要卡好半天,等问题解决了才发现原来一些细节知识点还是没有掌握好。今天golang学习网就整理分享《在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, "")
}

我该如何将这个尸体传递给邮递员。


解决方案


您的问题不符合 StackOverflow 规则。

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

文中关于的知识介绍,希望对你的学习有所帮助!若是受益匪浅,那就动动鼠标收藏这篇《在Postman中填写请求正文》文章吧,也可关注golang学习网公众号了解相关技术文章。

声明:本文转载于:stackoverflow 如有侵犯,请联系study_golang@163.com删除
相关阅读
更多>
最新阅读
更多>
课程推荐
更多>