Last active
July 23, 2018 00:28
-
-
Save dwburke/3c42cf1767d69dfd8ef4ffd4befd8c8f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "github.com/gin-gonic/gin" | |
func AllGinParams(c *gin.Context) gin.Params { | |
var params gin.Params | |
for _, p := range c.Params { | |
params = append(params, gin.Param{Key: p.Key, Value: p.Value}) | |
} | |
req := c.Request | |
req.ParseForm() | |
for k, v := range req.PostForm { | |
if len(v) == 0 { | |
continue | |
} | |
params = append(params, gin.Param{Key: k, Value: v[0]}) | |
} | |
return params | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
deliberately skips multipart form data atm