FromBody attribute
The FromBody attribute directs ASP.NET Core model binding to deserialize a parameter or property value from the HTTP request body.
ASP.NET Core in Action, 3e
The FromBody attribute is an ASP.NET Core parameter-binding attribute that specifies binding a parameter from the deserialized HTTP request body.
- How it is used
- Directs ASP.NET Core model binding to obtain a parameter from JSON content in an HTTP request body.
- How deep it goes
- Explains JSON deserialization, binding-source precedence, media-type failures, verb restrictions, and multiple-body-parameter errors.
- Examples
- Uses a Product record in a POST endpoint and a List<Photo> parameter in a Razor Pages handler.
- What you can do after
- Apply it via ASP.NET Core handler parameters to select JSON body binding and avoid common request-shape errors.
Read how ASP.NET Core in Action, 3e explains FromBody attribute →
Pro ASP.NET Core 7, Tenth Edition
The FromBody attribute is an ASP.NET Core parameter attribute that specifies that a parameter value should be read from the HTTP request body.
- How it is used
- Selects the HTTP request body as the model-binding source for an action parameter receiving JSON.
- How deep it goes
- Shows parameter placement and a working POST request, but defers the complexities of model binding and data validation.
- Examples
- Uses Product actions and PowerShell JSON POST and PUT requests, including a POST whose bound object is returned.
- What you can do after
- Apply it via ASP.NET Core MVC to bind a JSON request body to a controller action parameter.
Read how Pro ASP.NET Core 7, Tenth Edition explains FromBody attribute →
Related concepts
- payloaduses · A payload is the data, code, or other material carried by or attached to a message, token, system, or operation.
- ApiControllercontrasts with · ApiController is an ASP.NET Core attribute that enables API-specific conventions and behavior for controller classes, including request binding and validation handling.
- model bindingconfigures · Model binding is the process of locating incoming data, converting it to appropriate types, and assigning it to application objects or handler parameters.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

