Alex Rivera | Logout

ASP.NET Web Api and UrlDecode

Asked 2012-02-22T22:50:15.943
9

Is this a bug in the framework?

I have to use HttpUtility.UrlDecode here. I thought things were automatically decoded in MVC.

    public Thingy[] Get(string id)
    {
        var actualId = HttpUtility.UrlDecode(id ?? string.Empty);

        var result = MakeThingy(actualId );
        return result;
    }

I should be able to just do this ...

    public Thingy[] Get(string id)
    {
        var result = MakeThingy(id ?? string.Empty);
        return result;
    }
Edit
Report

1 Answer

11

It's a known bug. We'll fix it for the next release.

answered 2012-02-22T22:51:18.337

Your Answer