mirror of https://github.com/gin-gonic/gin.git
8ee9d959a0
* Now you can parse the inline lowercase start structure package main import ( "encoding/json" "fmt" "github.com/gin-gonic/gin" ) type appkey struct { Appkey string `json:"appkey" form:"appkey"` } type Query struct { Page int `json:"page" form:"page"` Size int `json:"size" form:"size"` appkey } func main() { router := gin.Default() router.POST("/login", func(c *gin.Context) { var q2 Query if c.ShouldBindQuery(&q2) == nil { c.JSON(200, &q2) } }) router.Run(":8088") } http client: old: curl -X POST "127.0.0.1:8088/login?appkey=china&page=1&size=10" {"page":1,"size":10,"appkey":""} now: curl -X POST "127.0.0.1:8088/login?appkey=china&page=1&size=10" {"page":1,"size":10,"appkey":"china"} * Modify judgment conditions |
||
---|---|---|
.. | ||
binding.go | ||
binding_body_test.go | ||
binding_test.go | ||
default_validator.go | ||
form.go | ||
form_mapping.go | ||
form_mapping_benchmark_test.go | ||
form_mapping_test.go | ||
json.go | ||
msgpack.go | ||
protobuf.go | ||
query.go | ||
uri.go | ||
validate_test.go | ||
xml.go | ||
yaml.go |