how to post arbitrary json object to webapi

前端 未结 4 979
甜味超标
甜味超标 2020-12-14 01:20

How do I / is it possible to pass in a json object to a webapi controller (POST) and not have a class to map it to, but rather handle it as arbitrary content?

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-14 01:31

    In your input, "_id": ObjectId("5069f825cd4c1d590cddf206") is what is breaking the JSON materialization on the server. Removing ObjectId and using "_id" : "5069f825cd4c1d590cddf206" works with JObject as well as Dictionary

提交回复
热议问题