avatar

目录
asp.net core3.1 webapi post请求返回http 400

在Asp.net core 3.0的webapi项目中,发送json格式的post请求后,返回的header中error提示The JSON value could not be converted to

解决方法:

1.安装Microsoft.AspNetCore.Mvc.NewtonsoftJson

2.在ConfigureServices中添加

services.AddNewtonsoftJson();

其他文章:

《.NET Core 内置的 System.Text.Json 使用注意》

文章作者: HJY
文章链接: https://hjy-dev.github.io/2020/05/17/asp-net-core3-1-webapi-post%E8%AF%B7%E6%B1%82%E8%BF%94%E5%9B%9Ehttp-400/
版权声明: 本博客所有文章除特别声明外,均采用 Apache License 2.0 许可协议。转载请注明来自 Kiven Blog
打赏
  • 微信
    微信
  • 支付寶
    支付寶

评论