Unosquare
    Show / Hide Table of Contents

    Namespace EmbedIO.WebApi

    Classes

    FormDataAttribute

    Specifies that a parameter of a controller method will receive a of HTML form data, obtained by deserializing a request body with a content type of application/x-www-form-urlencoded.

    The received collection will be read-only.

    This class cannot be inherited.

    FormFieldAttribute

    Specifies that a parameter of a controller method will receive the value(s) of a field in a HTML form, obtained by deserializing a request body with a content type of application/x-www-form-urlencoded.

    The parameter carrying this attribute can be either a simple type or a one-dimension array.

    If multiple values are present for the field, a non-array parameter will receive the last specified value, while an array parameter will receive an array of field values converted to the element type of the parameter.

    If a single value is present for the field, a non-array parameter will receive the value converted to the type of the parameter, while an array parameter will receive an array of length 1, containing the value converted to the element type of the parameter

    If no values are present for the field and the BadRequestIfMissing property is true, a 400 Bad Request response will be sent to the client, with a message specifying the name of the missing field.

    If no values are present for the field and the BadRequestIfMissing property is false, a non-array parameter will receive the default value for its type, while an array parameter will receive an array of length 0.

    This class cannot be inherited.

    JsonDataAttribute

    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.

    QueryDataAttribute

    Specifies that a parameter of a controller method will receive a of HTML form data, obtained by deserializing a request URL query.

    The received collection will be read-only.

    This class cannot be inherited.

    QueryFieldAttribute

    Specifies that a parameter of a controller method will receive the value of a field, obtained by deserializing a request URL query.

    The parameter carrying this attribute can be either a simple type or a one-dimension array.

    If multiple values are present for the field, a non-array parameter will receive the last specified value, while an array parameter will receive an array of field values converted to the element type of the parameter.

    If a single value is present for the field, a non-array parameter will receive the value converted to the type of the parameter, while an array parameter will receive an array of length 1, containing the value converted to the element type of the parameter

    If no values are present for the field and the BadRequestIfMissing property is true, a 400 Bad Request response will be sent to the client, with a message specifying the name of the missing field.

    If no values are present for the field and the BadRequestIfMissing property is false, a non-array parameter will receive the default value for its type, while an array parameter will receive an array of length 0.

    This class cannot be inherited.

    WebApiController

    Inherit from this class and define your own Web API methods You must RegisterController in the Web API Module to make it active.

    WebApiModule

    A module using class methods as handlers.

    Public instance methods that match the WebServerModule.ResponseHandler signature, and have the WebApi handler attribute will be used to respond to web server requests.

    WebApiModuleBase

    A module using objects derived from WebApiController as collections of handler methods.

    WebApiModuleExtensions

    Provides extension methods for WebApiModule.

    Interfaces

    INonNullRequestDataAttribute<TController, TData>

    Represents an attribute, applied to a parameter of a web API controller method, that causes the parameter to be passed deserialized data from a request.

    The difference between this interface and IRequestDataAttribute<TController, TData> is that attributes implementing this interface never retrieve null values.

    IRequestDataAttribute<TController>

    Represents an attribute, applied to a parameter of a web API controller method, that causes the parameter to be passed deserialized data from a request.

    IRequestDataAttribute<TController, TData>

    Represents an attribute, applied to a parameter of a web API controller method, that causes the parameter to be passed deserialized data from a request.

    The difference between this interface and INonNullRequestDataAttribute<TController, TData> is that attributes implementing this interface can retrieve null values.

    Comments

    Back to top Copyright © 2017-2019 Unosquare