From 977ab9ec87cd7c367e2911312f0f3c5a92213c6f Mon Sep 17 00:00:00 2001 From: CareyWong Date: Mon, 9 Mar 2020 10:11:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=B7=E6=B1=82=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 4a1414b..a5ca542 100644 --- a/main.go +++ b/main.go @@ -53,7 +53,7 @@ func main() { panic("Bitly api token is required.") } - router.GET("/", func(c *gin.Context) { + router.POST("/", func(c *gin.Context) { res := &Response{ Code: 0, Message: "", @@ -61,7 +61,7 @@ func main() { ShortUrl: "", } - longUrl := c.Query("longUrl") + longUrl := c.PostForm("longUrl") if longUrl == "" { res.Message = "longUrl为空" c.JSON(400, *res)