While porting an existing Web API 2 app to ASP.NET Core, I've noticed that now we're required to apply the FromBodyAttribute
to an action method's parameter (POST request with json payload):
[HttpPost]
public IActionResult([FromBody]MyComplexType parameter){ ... }
I've tried searching the docs but haven't found anything that explains the rationale behind this decision. I did find a post that says that this was done in order to improve security (CSRF scenarios).
Can someone please give more info about this?
Thanks.
Luis