C# – WebApi / Routing with URL Encoding

asp.net-web-apiasp.net-web-api-routingcencodingurl

Related to this: URL-encoded slash in URL

I used Mehrdad Afshari's answer (wildcard route param) which works mostly! However, multiple slashes are converted to a single slash.

My route is resource/{*url}

With GET resource/abc%2fdef my controller method is called with abc/def.

With GET resource/abc%2f%2f%2f%2fdef my controller method is again called with abc/def. The extra slashes are lost.