为了账号安全,请及时绑定邮箱和手机立即绑定

webapi 跨域的 问题

webapi 跨域的 问题

烙印99 2018-08-17 06:09:48
用 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()似乎是值绑定的问题!
查看完整描述

1 回答

?
ABOUTYOU

TA贡献1812条经验 获得超5个赞

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


查看完整回答
反对 回复 2018-09-04
  • 1 回答
  • 0 关注
  • 1385 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信