Using Web API 2, I am trying to expose an endpoint with the following Route
attribute:
[Route("foo/{id}/bar")]
public HttpResponseMessage Foo(string id)
I want to be able to pass the value .
or ..
into my id
variable. It seems it's impossible, I tried encoding the path segment (foo/%2E/bar
) with no luck.
Reading the RFC about URL normalization, it seems dots in path segments should not be encoded, BUT path segments containing only one or two dots (and only this) must be simplified. Does this mean that URL explicitly forbid what I am trying to achieve by design?