gin获取post中json
func PostJson(c *gin.Context) {
data, err := ioutil.ReadAll(c.Request.Body)
if err != nil {
c.JSON(http.StatusOK, gin.H{
"error": err,
})
} else {
c.JSON(http.StatusOK, gin.H{
"json": string(data),
})
}
}