WebApi调用中的转义字符 [英] Escape characters in WebApi call

查看:166
本文介绍了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?

推荐答案

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调用中的转义字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆