Golang GROM Accept Parameters(Post/Get)

//Accept file format upload
file, header, err := c.Request.FormFile(“file”)
if err != nil {
panic(err)
}
defer file.Close()

//accept header information
token := c.Request.Header.Get(“token”)
if token == “” {
c.AsciiJSON(http.StatusOK, map[string]interface{}{
“response”: fail(msg(“Data is empty”, lang)),
})
return &userInfo, 0
}
//accept post format

lang := c.DefaultPostForm(“lang”, “”)

//accept get format
lang := c.GetPostForm(“lang”, “”)

Leave a Reply

Your email address will not be published.

en_USEnglish