Skip to content

Commit

Permalink
Merge pull request #772 from gin-gonic/patch-3
Browse files Browse the repository at this point in the history
Improve document for #742
  • Loading branch information
appleboy authored Jan 2, 2017
2 parents 713c369 + 93e3640 commit ff17a8d
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,41 @@ func main() {
}
```
#### Bind Query String
See the [detail information](https://github.com/gin-gonic/gin/issues/742#issuecomment-264681292).
```go
package main
import "log"
import "github.com/gin-gonic/gin"
type Person struct {
Name string `form:"name"`
Address string `form:"address"`
}
func main() {
route := gin.Default()
route.GET("/testing", startPage)
route.Run(":8085")
}
func startPage(c *gin.Context) {
var person Person
if c.Bind(&person) == nil {
log.Println(person.Name)
log.Println(person.Address)
}
c.String(200, "Success")
}
```
### Multipart/Urlencoded binding
###Multipart/Urlencoded binding
```go
package main
Expand Down

0 comments on commit ff17a8d

Please sign in to comment.