December 2017
Intermediate to advanced
316 pages
6h 58m
English
We can have encoded paths from a few clients. To handle these encoded paths, Mux provides a method called UseEncodedPath. If we call this method on the router variable, we can even match the encoded URL route and forward it to the given handler:
r := NewRouter() r.UseEncodedPath()r.NewRoute().Path("/category/id")
This can match the URL:
http://localhost:8000/books/1%2F2
%2F stands for / in the un-encoded form. If the method UseEncodedPath is not used, the router might understand it as /v1/1/2.
Read now
Unlock full access