Short solution for short problems

API.NET: Web API How to handle space or %20 in URL route

Failed to load resource: the server responded with a status of 404 (Not Found)

accounts.bdo.be/:1 Failed to load ...Accounts/Lookup/A.D.V.%20/maxrows/10

This is what I got when trying to call a web API. The space, even encoded was giving trouble. When you have this problem, do not look to far, do not start rewriting the url. 

Just add this to your config file in the Web API:

    <compilation debug="true" targetFramework="4.6.1" />
    <httpRuntime targetFramework="4.5.2" relaxedUrlToFileSystemMapping="true" />

More info on this here:


blog comments powered by Disqus