标签:ring turn lazy amp password red ldb src 图片
package main import ( "github.com/gin-gonic/gin" ) type Login struct { User string `form:"username" json:"user" uri:"user" xml:"user" binding:"required"` Password string `form:"password" json:"password" uri:"password" xml:"password" binding:"required"` } func main() { router := gin.Default() router.GET("/:user/:password", func(c *gin.Context) { var login Login if err := c.ShouldBindUri(&login); err != nil { c.JSON(400, gin.H{"msg": err}) return } c.JSON(200, gin.H{"username": login.User, "password": login.Password}) }) router.Run(":8080") }
标签:ring turn lazy amp password red ldb src 图片
原文地址:https://www.cnblogs.com/yzg-14/p/13143815.html