I use a mux router with a function handler
r := mux.NewRouter()
r.HandleFunc("/test/{myfirst}/{mysecond}/{third:[0-9]+}",TestHandler)
The test handler is defined as follows:
func TestHandler(response http.ResponseWriter, request *http.Request) {
response.Header().Set("Content-type", "text/html")
err := request.ParseForm()
if err != nil {
http.Error(response, fmt.Sprintf("error parsing url %v", err), 500)
}
vars := mux.Vars(request)
first := vars["myfirst"]
second := vars["mysecond"]
third := vars["mythird"]
}
I call the page with
http://localhost/test/first/second/third/1234
But I get a 404. Also third:value didn't work. What is the right url? And can I retrieve vars of a name/value pair like this?