With a routing and controller
[HttpGet]
[Route("api/test/{term}")]
public IHttpActionResult Get(string term)
{
}
I want the request to api/test/1%20
(UrlEncoded "1 "
) be populated to the term
parameter as a "1 "
value. I've enabled the <httpRuntime relaxedUrlToFileSystemMapping="true" />
in system.web
section of web.config so the requests are coming through, however, the trailing space is removed.
The endpoint is used for some sort of suggestion functionality therefore values "1"
and "1 "
returns different results.
All discussions about potential solution I was able to find are talking more about howto accept such request:
WebAPI route 404's when there is a trailing space in the URL