Docs · API reference · Motus.Abstractions

IRoute Interface#

Represents an intercepted network route that can be fulfilled, continued, or aborted.

public interface IRoute

Properties#

Request Property#

Gets the request associated with this route.

Motus.Abstractions.IRequest Request { get; }

Property Value#

IRequest

Methods#

AbortAsync(string) Method#

Aborts the route.

System.Threading.Tasks.Task AbortAsync(string? errorCode=null);

Parameters#

errorCode System.String

Optional error code (e.g. "aborted", "accessdenied", "connectionrefused").

Returns#

System.Threading.Tasks.Task

ContinueAsync(RouteContinueOptions) Method#

Continues the route with optional modifications to the request.

System.Threading.Tasks.Task ContinueAsync(Motus.Abstractions.RouteContinueOptions? options=null);

Parameters#

options RouteContinueOptions

Options for continuing the route.

Returns#

System.Threading.Tasks.Task

FulfillAsync(RouteFulfillOptions) Method#

Fulfills the route with a custom response.

System.Threading.Tasks.Task FulfillAsync(Motus.Abstractions.RouteFulfillOptions? options=null);

Parameters#

options RouteFulfillOptions

Options for the response.

Returns#

System.Threading.Tasks.Task