本文介绍了WebApi调用中的转义字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个非常奇怪的问题,因为我不能张贴任何带有句点的文本.这是我的Ajax调用的网址:
I have this very weird issue in that I cannot post over any text with a period in it. Here's the url for my ajax call:
url = 'BIReports/SaveReport/' + reportDescription;
如果reportDescrption中包含句点,则不会发布.想法?
If reportDescrption has a period in it, it doesnt post. Ideas?
推荐答案
如菲尔·哈克(Phil Haack)的博客,您可能需要尝试将 relaxedUrlToFileSystemMapping
设置为 true
.
As described in Phil Haack's blog, you may want to try setting relaxedUrlToFileSystemMapping
to true
.
<configuration>
<system.web>
<httpRuntime relaxedUrlToFileSystemMapping="true"/>
<!-- ... your other settings ... -->
</system.web>
</configuration>
这篇关于WebApi调用中的转义字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!