【发布时间】:2016-10-08 12:14:19
【问题描述】:
我正在尝试将 URL 作为字符串参数传递给 API 控制器 POST 方法。但是,由于 URL 中的特殊字符“:”,我收到“潜在危险请求”错误。
URL 的格式为 'http|s://xxxxxxxxx/.../.... 等
我尝试了 encodeURI,但仍然失败。
$.ajax({
type: "POST",
url: "http://localhost:101/api/Sample/" + encodeURI(url),
contentType: "application/json; charset=utf-8",
dataType: "json"....
})
【问题讨论】:
标签: ajax url asp.net-web-api parameters controller