我要发送以下内容:
{
"setIds": ["1", "2"],
"folderIds": ["3", "4"],
"filter": "FILTERED"
};
到接受SessionDto的API端点:
[DataContract]
public class SessionDto
{
[DataMember(EmitDefaultValue = true)]
public Array FolderIds { get; set; }
[DataMember(EmitDefaultValue = true)]
public Array SetIds { get; set; }
[DataMember(IsRequired = true)]
public string Filter { get; set; }
}
setid和folderid总是空的;滤镜可以很好地通过。我用newtonsoft。json。serialization。任何想法为什么这不会工作,或者我如何进一步调试?
[DataMember(EmitDefaultValue = true)]
public int[] FolderIds { get; set; }
[DataMember(EmitDefaultValue = true)]
public int[] SetIds { get; set; }
[DataMember(IsRequired = true)]
public string Filter { get; set; }