My Route looks like:
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}/{uri}",
defaults: new { id = RouteParameter.Optional, uri = RouterParameter.Optional }
);
I have a Base64 encoded uri that I send in place of the {uri} parameter. It has no illegal characters (I've formatted it properly and checked to make sure). However, it's about 300-400 characters long.
When I send a DELETE request to this address using the long base64 parameter, I get a 400 BAD STATUS, INVALID URL response. When shortening the parameter, it works. I suspect that there is a max path problem?
Using a query string in place of a path parameter works, but I'd rather stay with the RESTful approach. Is there a config setting I can change on my Web API project to allow longer path-based parameters?
This works:
http://localhost:99999/api/reg/10?uri=<long_base64_parameter>
This does not work:
http://localhost:99999/api/reg/10/<long_base64_parameter>