package mainimport ("net/http""/gin-gonic/gin")func main() {r := gin.Default()r.GET("/get", func(c *gin.Context) {c.JSON(http.StatusOK, gin.H{"请求类型:": "GET",})})r.POST("/post", func(c *gin.Context) {c.String(200, "发送的是post请求")})r.PUT("/put", func(c *gin.Context) {c.JSON(http.StatusOK, gin.H{"你请求的是:": "put",})})r.DELETE("/delete", func(c *gin.Context) {c.JSON(http.StatusOK, gin.H{"发送的是:": "delete请求",})})r.Run()}
600字范文,内容丰富有趣,生活中的好帮手!