I'm trying to invoke a Gurilla Mux handler programmatically in another handler function. Simply calling that handler function won't work, because it uses mux.Vars()
. What I have at hand is a URL. Therefore, I'm looking for a way to invoke that handler function just as if the user has visited that URL, and I want the response back to further process it. Does anyone know a way to do it?
Asked
Active
Viewed 83 times
0

Derek Chiang
- 3,330
- 6
- 27
- 34
1 Answers
0
Why wouldn't calling the function work? The data for mux.Vars()
is stored in a global context that maps requests into the relevant data. As long as you pass the same request pointer into the handler, it will be able to access mux.Vars()
.

justinas
- 6,287
- 3
- 26
- 36