RESTful

[PATCH] 方法可以用来更新资源的一个组成部分。举个例子,当你仅需更新资源的某一项,[PUT] 一个完整的资源就显得很累赘同时会消耗更多带宽。

func main() {
	router := gin.Default()

	router.GET("/someGet", getting)
	//router.POST("/somePost", posting)
	//router.PUT("/somePut", putting)
	//router.DELETE("/someDelete", deleting)
	//router.PATCH("/somePatch", patching)
	//router.HEAD("/someHead", head)
	//router.OPTIONS("/someOptions", options)

	router.Run()
}

func getting(c *gin.Context)  {
	c.String(200, "hello!!!")

}

  

原文地址:https://www.cnblogs.com/yzg-14/p/13137712.html