web-api POST body object always null

前端 未结 26 3040
余生分开走
余生分开走 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:32

    This is another issue related to invalid property values in an Angular Typescript request.

    This is was related to the conversion between a Typescript number to an int(Int32) in C#. I was using Ticks (UTC milliseconds) which is larger than the signed, Int32 range (int in C#). Changed the C# model from int to long and everything worked fine.

提交回复
热议问题