web-api POST body object always null

前端 未结 26 2975
余生分开走
余生分开走 2020-11-27 15:03

I\'m still learning web API, so pardon me if my question sounds stupid.

I have this in my StudentController:

public HttpResponseMessage          


        
26条回答
  •  庸人自扰
    2020-11-27 15:24

    This is a little old one and my answer will go down to the last place but even so I would like to share my experience.

    Tried every suggestion but still having the same "null" value in a PUT [FromBody].

    Finally found it was all about Date format while JSON serializing the EndDate property of my Angular Object.

    No error was thrown, just received an empty FromBody object....

提交回复
热议问题