Model always null on XML POST

前端 未结 5 1260
耶瑟儿~
耶瑟儿~ 2020-11-30 22:36

I\'m currently working on an integration between systems and I\'ve decided to use WebApi for it, but I\'m running into an issue...

Let\'s say I have a model:

5条回答
  •  -上瘾入骨i
    2020-11-30 23:15

    For me it was having more than one xmlFormatter added to the config.

    While debugging I discovered the list of formatters, with a duplicate one.

    config.Formatters.Add(new XmlMediaTypeFormatter());
    

    Removed that line and it worked.

    Files to check for that line

    • Global.acax.cs
    • WebApiConfig.cs

提交回复
热议问题