首页 新闻 会员 周边

webapi 跨域的 问题

0
[已解决问题] 解决于 2018-05-21 11:35

Microsoft.AspNet.WebApi.Cors实现WEBAPI的跨域,跨域似乎是可以了,但是引发了另一个错误,如下:

处理 HTTP 请求导致了异常。请参见此异常的 "Response" 属性返回的 HTTP 响应,以了解详细信息。
StackTrace: 在 System.Web.Http.ModelBinding.FormatterParameterBinding.ReadContentAsync(HttpRequestMessage request, Type type, IEnumerable`1 formatters, IFormatterLogger formatterLogger, CancellationToken cancellationToken)
在 System.Web.Http.ModelBinding.FormatterParameterBinding.ReadContentAsync(HttpRequestMessage request, Type type, IEnumerable`1 formatters, IFormatterLogger formatterLogger)
在 System.Web.Http.ModelBinding.FormatterParameterBinding.<ExecuteBindingAsyncCore>d__18.MoveNext()

似乎是值绑定的问题!

chenhp的主页 chenhp | 初学一级 | 园豆:9
提问于:2018-05-21 11:10
< >
分享
最佳答案
0

请求时有没有设置 Content-Type: application/json ?

奖励园豆:5
dudu | 高人七级 |园豆:31003 | 2018-05-21 11:20

汗。。。还真是。麻烦大神了!

chenhp | 园豆:9 (初学一级) | 2018-05-21 11:35
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册