web api put is recognizing query strings but not body

后端 未结 1 1039
小鲜肉
小鲜肉 2020-12-06 20:54

when i pass in users as a query string (using params in $http) and set the web api method to look for them in the uri everything is peachy. but when i pass them in as below

相关标签:
1条回答
  • 2020-12-06 21:01

    Try: data: users instead of data: data.

    In asp.net api, the whole request body is bound to a parameter. For this reason, you cannot have multiple parameters with the [FromBody] in the action method parameters. There is only one => we don't need to specify a property name in the request body.

    0 讨论(0)
提交回复
热议问题