update readme: add YAML example.

This commit is contained in:
Bo-Yi Wu 2016-04-15 15:23:47 +08:00 committed by Rohan Shah
parent 50724861f4
commit 8aecdc9980

View File

@ -413,7 +413,7 @@ $ curl -v --form user=user --form password=password http://localhost:8080/login
```
#### XML and JSON rendering
#### XML, JSON and YAML rendering
```go
func main() {
@ -443,6 +443,10 @@ func main() {
c.XML(http.StatusOK, gin.H{"message": "hey", "status": http.StatusOK})
})
r.GET("/someYAML", func(c *gin.Context) {
c.YAML(http.StatusOK, gin.H{"message": "hey", "status": http.StatusOK})
})
// Listen and server on 0.0.0.0:8080
r.Run(":8080")
}