Table of Contents

Class RejectWithMessageAction

Namespace
Fluxzy.Rules.Actions.HighLevelActions
Assembly
Fluxzy.Core.dll

Reject the request with a custom HTTP status code and a custom body message.

[ActionMetadata("Block the request with a custom HTTP error response including a body message. Useful for providing detailed blocking reasons to end users. Supports text/plain, text/html, and application/json content types.")]
public class RejectWithMessageAction : Action
Inheritance
RejectWithMessageAction
Inherited Members

Constructors

RejectWithMessageAction()

[JsonConstructor]
public RejectWithMessageAction()

RejectWithMessageAction(int, string, string)

public RejectWithMessageAction(int statusCode, string message, string contentType = "text/plain")

Parameters

statusCode int
message string
contentType string

Properties

ActionScope

public override FilterScope ActionScope { get; }

Property Value

FilterScope

ContentType

The content type of the message (text/plain, text/html, application/json).

public string ContentType { get; set; }

Property Value

string

DefaultDescription

public override string DefaultDescription { get; }

Property Value

string

Message

The response body message.

public string Message { get; set; }

Property Value

string

StatusCode

The HTTP status code to return.

public int StatusCode { get; set; }

Property Value

int

Methods

GetExamples()

public override IEnumerable<ActionExample> GetExamples()

Returns

IEnumerable<ActionExample>

InternalAlter(ExchangeContext, Exchange?, Connection?, FilterScope, BreakPointManager)

public override ValueTask InternalAlter(ExchangeContext context, Exchange? exchange, Connection? connection, FilterScope scope, BreakPointManager breakPointManager)

Parameters

context ExchangeContext
exchange Exchange
connection Connection
scope FilterScope
breakPointManager BreakPointManager

Returns

ValueTask