I have rest API defined as
apis.GET(/home, validatationHandler , dashboardHandler)
I want pass some data from validatationHandler to dashboardHandler. For this I thought of using header. To set the data I use this in validatationHandler
c.Writer.Header().Set("myheader", "mytoken")
c.Next()
and in dashboardHandler I tried to access it using
fmt.Println(c.Request.Header.Get("myheader"))
But the value is always nil. Any idea how can I set and retrieve headers? Is there any other way I can pass on the data from 1 handler to another?