ASP.NET Web Api 和 UrlDecode
这是框架中的错误吗?
我必须在这里使用 HttpUtility.UrlDecode 。我以为 MVC 中的东西会自动解码。
public Thingy[] Get(string id)
{
var actualId = HttpUtility.UrlDecode(id ?? string.Empty);
var result = MakeThingy(actualId );
return result;
}
我应该能够做到这一点......
public Thingy[] Get(string id)
{
var result = MakeThingy(id ?? string.Empty);
return result;
}
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;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个已知的错误。我们将在下一个版本中修复它。
It's a known bug. We'll fix it for the next release.