首页 > Windows开发 > 详细

web-api POST body object always null

时间:2019-11-07 22:13:32      阅读:97      评论:0      收藏:0      [点我收藏+]
 

If the any of values of the request‘s JSON object are not the same type as expected by the service then the [FromBody] argument will be null.

For example, if the age property in the json had a float value:

"age":18.0

but the API service expects it to be an int

"age":18

then student will be null. (No error messages will be sent in the response unless no null reference check).

web-api POST body object always null

原文:https://www.cnblogs.com/xujie520/p/11815870.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!