我有一个问题,当将 json 从客户端传递到 bakend 时,一个属性无法映射到实体。这是我作为参数收到的模型。
public class Utnker
{
public string Property1 { get; set; }
...
public TimeSpan time { get; set; }
}
当我使用字符串打发时间时,它无法触发bakend。
let Data = {
'Property':'b',
'time':'10.12:6:8'
};
fetch('', {
method: 'POST',
mode: 'cors',
credentials: 'include',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: JSON.stringify(Data)
}).then(function(response) {
console.log(response);
});
当我使用本地 json 转换器转换 json 时,它可以得到预期的结果。