写一个asp.net web api的时候, 声明一个 httppost 提交的json 返回
“type”: “https://tools.ietf.org/html/rfc7231#section-6.5.1”,
“title”: “One or more validation errors occurred.”,
“status”: 400,
“traceId”: “00-dc9240fa586368ecc923c6dea453444b-e5da478d7b0ee942-00”,
提交的json大概如下
{
'id' :'2',
'name' :'ss'
}
折腾半天才明白, 是因为使用了 单引号 ’ 导致的.
更换为双引号 "
才能被[FromBody] 正确序列化