更新时间:2021-09-15 21:58:50
您的型号
以字符串
表示形式发布,不是 JSON
。 await modelContent.ReadAsStringAsync()
将以数组表示法返回一个字符串: [object Object]
。
Your model
gets posted in its string
representation, which is not JSON
.await modelContent.ReadAsStringAsync()
will return a string in array-notation: [object Object]
.
您必须自己处理JSON序列化。
You'll have to take care of the JSON serialization yourself.
替换
data.append("model", { "TenantId": this.state.TenantId, "TenantUrl": this.state.TenantUrl, "TenantPassword": this.state.TenantPassword });
with
data.append("model", JSON.stringify({ "TenantId": this.state.TenantId, "TenantUrl": this.state.TenantUrl, "TenantPassword": this.state.TenantPassword }));
'无法将当前JSON对象(例如{" Name":" value"})反序列化为类型'system.collections.generic.list`1 ...
无法将当前JSON对象(例如{"name":"value"})反序列化为"System.Collections.Generic.List"类型
JSON.Net-无法将当前json对象(例如{"name":"value"})反序列化为类型'system.collections.generic.list`1
无法将 JSON 数组(例如 [1,2,3])反序列化为类型“",因为类型需要 JSON 对象(例如 {“name":“value"})才能正确反序列化
无法将当前JSON数组(例如[1,2,3])反序列化为类型'TenantManagementWebApi.Entities.Tenant
无法将当前json对象反序列化,因为(例如。{name":" value"}})因为类型需要json数组(例如[1,2,3])