How to get the JSON from the Body of a Request on Go

前端 未结 2 1992
星月不相逢
星月不相逢 2020-12-30 14:57

I\'m a newbie with Go, but so far I\'m liking it very much.

I have a problem I can\'t figure out. I\'m migrating an API from Node to Go and there is this log where I

2条回答
  •  抹茶落季
    2020-12-30 15:42

    I believe you can do this:

    m := make(map[string]interface{});
    if err := context.Bind(&m); err != nil {
        return result, err
    }
    fmt.Println(m)
    

提交回复
热议问题