Skip to content

Class JsonRpcHttpBehaviorBinding

Namespace: Cephalon.Behaviors.Http.Bindings
Assembly: Cephalon.Behaviors.Http.dll

JSON-RPC 2.0 HTTP transport binding (transport ID: http.jsonrpc). Accepts canonical routes such as POST /json-rpc/v1/cart/get and returns a JSON-RPC 2.0 response or error object. Per the JSON-RPC 2.0 specification the HTTP status is always 200 OK.

public sealed class JsonRpcHttpBehaviorBinding : IHttpBehaviorBinding

objectJsonRpcHttpBehaviorBinding

IHttpBehaviorBinding

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Canonical routes are derived from the shared plus the configured JSON-RPC prefix (canonically ApiRoutes:Prefixes:JsonRpc) and the resolved default behavior document name.

JsonRpcHttpBehaviorBinding(IConfiguration?)

Section titled “ JsonRpcHttpBehaviorBinding(IConfiguration?)”

Initializes a new .

public JsonRpcHttpBehaviorBinding(IConfiguration? configuration = null)

configuration IConfiguration?

Optional configuration used to resolve canonical behavior transport routes. When omitted, the binding falls back to the default /json-rpc/v1 route policy.

Gets the canonical transport identifier, e.g. http.jsonrpc.

public string TransportId { get; }

string

MapAsync(WebApplication, BehaviorTopologyDescriptor, BehaviorDispatcher)

Section titled “ MapAsync(WebApplication, BehaviorTopologyDescriptor, BehaviorDispatcher)”

Maps the behavior’s routes/endpoints onto the . Called at most once per descriptor per transport (lazy-init guards ensure this).

public Task MapAsync(WebApplication app, BehaviorTopologyDescriptor descriptor, BehaviorDispatcher dispatcher)

app WebApplication

The web application to register routes on.

descriptor BehaviorTopologyDescriptor

The behavior topology descriptor.

dispatcher BehaviorDispatcher

The behavior dispatcher to invoke.

Task

A task that completes when all routes are mapped.