Skip to content
Myr

Update README.md (#1509)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

change `ShouldBindXML` to `ShouldBindJSON`

authored by llgoer · committed by 田欧 · parent 09d342a · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:README.md+1 added-1 removed
555 unmodified lines
556557 // Example for binding JSON ({"user": "manu", "password": "123"})558 router.POST("/loginJSON", func(c *gin.Context) {559 var json Login560 if err := c.ShouldBindXML(&json); err != nil {560 if err := c.ShouldBindJSON(&json); err != nil {561 c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})562 return563 }564
1325 unmodified lines