POST JSON Dictionary without Key/Value Text

后端 未结 4 458
醉梦人生
醉梦人生 2020-12-11 17:00

I have a WCF endpoint that is like such:

[OperationContract]
[WebInvoke(Method = \"POST\", BodyStyle = WebMessageBodyStyle.WrappedRequest, ResponseFormat = W         


        
4条回答
  •  北海茫月
    2020-12-11 17:20

    You basically need a SerializableDynamic Object, so that your method will look like this:

    [OperationContract]
    [WebInvoke(...)]
    Stream DoWork(SerializableDynamicObject items);
    

    You can see a good guide on how to build the SerializableDynamic Object from a Dictionary here: (see Solution section). Hope this helps...

提交回复
热议问题