在 ASP.NET Core 3.0 中,在
当客户端以内容类型:
ApiController
上使用 [FromBody]
字符串内容会返回验证错误。{"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."]}}
当客户端以内容类型:
application/json
发送数据时,我该如何在.NET Core 3.0的API控制器中获取原始的JSON数据字符串?而无需客户端更新其内容类型。