From e67cd9185ee2f8b8a6e4d660c54f444ecd0e6a05 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Fri, 15 Apr 2016 15:23:47 +0800 Subject: [PATCH] update readme: add YAML example. --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 99a6d0bf..b734ac0b 100644 --- a/README.md +++ b/README.md @@ -412,7 +412,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() { @@ -442,6 +442,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") }