import "github.com/gin-gonic/gin"
func Receive(c *gin.Context) {
// Gets JSON ecnoded data
rawData, err := c.GetRawData()
if err != nil {
return nil, err
}
logger.Info("Raw data received - ", rawData)
}
This code snippet works when I pass a Json object {"key":"value"} but gives an error - "unexpected end of JSON input" when I pass an array like - [{"key":"val"},{"key": "val"}] as the input.
Any help on this would be appreciated.