瀏覽代碼

update readme: add YAML example.

Bo-Yi Wu 9 年之前
父節點
當前提交
e67cd9185e
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      README.md

+ 5 - 1
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")
 }