How can I send a GET request containing a colon, to an ASP.NET MVC2 controller?

Posted by Cheeso on Stack Overflow See other posts from Stack Overflow or by Cheeso
Published on 2010-04-07T14:15:38Z Indexed on 2010/04/07 14:43 UTC
Read the original article Hit count: 464

Filed under:
|

This works fine:

GET /mvc/Movies/TitleIncludes/Lara%20Croft

When I submit a request that contains a colon, like this:

GET /mvc/Movies/TitleIncludes/Lara%20Croft:%20Tomb

...it generates a 400 error. The error says ASP.NET detected invalid characters in the URL.

If I try url-escaping, the request looks like this:

GET /mvc/Movies/TitleIncludes/Lara%20Croft%3A%20Tomb

...and this also gives me a 400 error.

If I replace the colon with a | :

GET /mvc/Movies/TitleIncludes/Lara%20Croft|%20Tomb

..that was also rejeted as illegal, this time with a 500 error. The message: Illegal characters in path.

URL-escaping that | results in the same error.


I really, really don't want to use a querystring parameter.


related:
Sending URLs/paths to ASP.NET MVC controller actions

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about urlencode