在ASP.NET Core 3.0中使用[FromBody]字符串内容会ApiController返回验证错误:
{"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title":"One or more validation errors occurred.",
"status":400,
"traceId":"|9dd96d96-4e64bafba4ba0245.",
"errors":{"$":["The JSON value could not be converted to System.String. Path: $ | LineNumber: 0 | BytePositionInLine: 1."]}}
Run Code Online (Sandbox Code Playgroud)
当客户端发布具有content-type的数据时: application/json
如何在.NET Core 3.0的api控制器中以字符串形式获取原始json数据?无需客户端更新其内容类型?