Skip to content

Commit

Permalink
修改请求方法
Browse files Browse the repository at this point in the history
  • Loading branch information
CareyWang committed Mar 9, 2020
1 parent 118c865 commit 977ab9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ 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: "",
LongUrl: "",
ShortUrl: "",
}

longUrl := c.Query("longUrl")
longUrl := c.PostForm("longUrl")
if longUrl == "" {
res.Message = "longUrl为空"
c.JSON(400, *res)
Expand Down

0 comments on commit 977ab9e

Please sign in to comment.