README.md: fix a typo (#2913)

This commit is contained in:
Allen Ren 2021-10-22 21:26:14 +08:00 committed by GitHub
parent 464535ff94
commit 34ae7777ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -2000,7 +2000,7 @@ func SomeHandler(c *gin.Context) {
objA := formA{} objA := formA{}
objB := formB{} objB := formB{}
// This reads c.Request.Body and stores the result into the context. // This reads c.Request.Body and stores the result into the context.
if errA := c.ShouldBindBodyWith(&objA, binding.JSON); errA == nil { if errA := c.ShouldBindBodyWith(&objA, binding.Form); errA == nil {
c.String(http.StatusOK, `the body should be formA`) c.String(http.StatusOK, `the body should be formA`)
// At this time, it reuses body stored in the context. // At this time, it reuses body stored in the context.
} else if errB := c.ShouldBindBodyWith(&objB, binding.JSON); errB == nil { } else if errB := c.ShouldBindBodyWith(&objB, binding.JSON); errB == nil {