I'm writing a handler that can take either POST or GET. As such, I want the option of being able to say:
http://host/query?parm1=value&parm2=value
I was assuming that Gorilla mux would then give me:
{
"parm1": "value",
"parm2": "value
}
but mux.Vars(r)
is empty. I'm aware that using .Query("key", "value"
will make the parameters mandatory, which isn't what I want. What am I missing?
mux.Vars
is for named parameters from your route. – Kalbr.URL.Query().Get("param1")
? – Kalb