[FromBody]

Marks a parameter as coming from the JSON body.

What is [FromBody]?

[FromBody] says a parameter comes from the JSON request body. For complex types in minimal APIs and [ApiController]s this is usually automatic.

[HttpPost]
public IActionResult Create([FromBody] NewRecipe recipe) => Ok();

Level: Apprentice · More ASP.NET Core terms at this level

Updated