Specifies that a parameter of a controller method will receive an object obtained by deserializing the request body as JSON.
The received object will be null only if the deserialized object is null
.
If the request body is not valid JSON, or if it cannot be deserialized to the type of the parameter, a 400 Bad Request
response will be sent to the client.
This class cannot be inherited.
InheritanceJsonDataAttribute
Namespace: EmbedIO.WebApi Syntaxpublic class JsonDataAttribute : Attribute, IRequestDataAttribute<WebApiController>
Methods GetRequestDataAsync(WebApiController, Type, String)
Asynchronously obtains data from a controller's context.
Declarationpublic Task<object> GetRequestDataAsync(WebApiController controller, Type type, string parameterName)
Parameters Type Name Description WebApiController controller Type type
The type of the parameter that has to receive the data.
String parameterNameThe name of the parameter that has to receive the data.
Returns Type Description Task<Object>a whose result will be the data to pass as a parameter to a controller method.
Implements See AlsoRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4