问题描述
所以,如果有网址连接我的应用程序的MVC网址codeD段,IIS会抛出一个错误的请求400。
例如。
的*9289--750W-Generic-ATX12V-Power-Supply-%252449dot99/6355
< ---在'*'和'%'是造成此错误
注意正常工作。
什么是任意的字符串转换为一个公认的MVC URL段的正确方法是什么?
更新:该URL段应类似于原始字符串。 Base64编码完全改变字符串。
而不是传递信息的网址,你可以把它作为一个GET参数。像这样的:
<$p$p><$c$c>http://u.lasoo.com.au/Offer/?id=*9289--750W-Generic-ATX12V-Power-Supply-%252449dot99/6355So, if there are url encoded segments in my apps MVC url, IIS throws a BAD REQUEST 400.
e.g.http://u.lasoo.com.au/Offer/*9289--750W-Generic-ATX12V-Power-Supply-%252449dot99/6355
<--- the '*' and '%' are causing this error.
Notice that http://u.lasoo.com.au/Offer/The-Giant-Good-As-Gone-7-Day-Sale/6354 works fine.
What's the correct way to convert an arbitrary string into an accepted MVC URL segment?
UPDATE: the URl segment should resemble the original string. Base64 encoding completely transformed the string.
Instead of passing the info in the url you can pass it as a get parameter. Like this:
http://u.lasoo.com.au/Offer/?id=*9289--750W-Generic-ATX12V-Power-Supply-%252449dot99/6355
这篇关于为HttpUtility.UrlEn codeD URL段错误请求400的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!