Interface IApiEndpoint
Implement to create a fully custom endpoint.
Namespace: DirectScale.Disco.Extension.Api
Assembly: DirectScale.Disco.Extension.Abstractions.dll
Syntax
public interface IApiEndpoint
Remarks
The method Post will be called when the defined route is called. This interface will provide the raw request body and headers for you to use. Use ApiEndpoint<TRequest> Implementation for a simplified interface if your request only needs a JSON model from the request body. Currently only custom apis receiving POST requests are supported. Custom API GET requests are unsupported.
Methods
GetDefinition()
Gets the definition for this endpoint.
Declaration
ApiDefinition GetDefinition()
Returns
Type | Description |
---|---|
ApiDefinition |
Post(ApiRequest)
Implement to create a custom api endpoint. Can receive any post request and return any response.
Declaration
IApiResponse Post(ApiRequest request)
Parameters
Type | Name | Description |
---|---|---|
ApiRequest | request | This is the full information coming from the request unparsed. See Post(TRequest) for automatic parsing. |
Returns
Type | Description |
---|---|
IApiResponse | A standard http response. |
See Also
ApiEndpoint<TRequest>