I want to create an api for uploading images in my go-gin application. This is my current api code :
func (s *Service) ImageCreate(c *gin.Context) {
token := c.MustGet(tokenKey).(*models.Token)
now := time.Now()
file, err := c.FormFile("file")
if err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": "01> " + err.Error()})
return
}
}
When I call my application from the browser it returns this error:
{"error":"01\u003e invalid URL escape \"%$\\xf4\""}
In postman api it's working without error. What is wrong? How I can fix it for the browser?