mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-22 17:42:14 +08:00
Merge branch 'master' into internal
This commit is contained in:
commit
84522a9018
@ -6,7 +6,7 @@ go:
|
||||
- 1.8.x
|
||||
- 1.9.x
|
||||
- 1.10.x
|
||||
- master
|
||||
- 1.11.x
|
||||
|
||||
git:
|
||||
depth: 10
|
||||
|
11
README.md
11
README.md
@ -557,7 +557,7 @@ func main() {
|
||||
// Example for binding JSON ({"user": "manu", "password": "123"})
|
||||
router.POST("/loginJSON", func(c *gin.Context) {
|
||||
var json Login
|
||||
if err := c.ShouldBindXML(&json); err != nil {
|
||||
if err := c.ShouldBindJSON(&json); err != nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
@ -750,9 +750,12 @@ See the [detail information](https://github.com/gin-gonic/gin/issues/742#issueco
|
||||
```go
|
||||
package main
|
||||
|
||||
import "log"
|
||||
import "github.com/gin-gonic/gin"
|
||||
import "time"
|
||||
import (
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type Person struct {
|
||||
Name string `form:"name"`
|
||||
|
Loading…
x
Reference in New Issue
Block a user