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
Properties
ActionScope
public override FilterScope ActionScope { get; }
Property Value
ContentType
The content type of the message (text/plain, text/html, application/json).
public string ContentType { get; set; }
Property Value
DefaultDescription
public override string DefaultDescription { get; }
Property Value
Message
The response body message.
public string Message { get; set; }
Property Value
StatusCode
The HTTP status code to return.
public int StatusCode { get; set; }
Property Value
Methods
GetExamples()
public override IEnumerable<ActionExample> GetExamples()
Returns
InternalAlter(ExchangeContext, Exchange?, Connection?, FilterScope, BreakPointManager)
public override ValueTask InternalAlter(ExchangeContext context, Exchange? exchange, Connection? connection, FilterScope scope, BreakPointManager breakPointManager)
Parameters
contextExchangeContextexchangeExchangeconnectionConnectionscopeFilterScopebreakPointManagerBreakPointManager