Table of Contents

Class NotAcceptableError

Namespace
Trellis
Assembly
Trellis.Results.dll

Represents a not acceptable error when the server cannot produce a representation that matches the client's stated preferences (e.g., Accept, Accept-Language). Maps to HTTP 406 Not Acceptable.

public sealed class NotAcceptableError : Error, IEquatable<Error>
Inheritance
NotAcceptableError
Implements
Inherited Members
Extension Methods

Examples

Error.NotAcceptable("No representation available for the requested media type.")

Remarks

Per RFC 9110 ยง15.5.7, a 406 response SHOULD generate content containing a list of available representation characteristics so the user or user agent can choose.

Constructors

NotAcceptableError(string, string, string?)

Initializes a new instance of the NotAcceptableError class.

public NotAcceptableError(string detail, string code, string? instance = null)

Parameters

detail string

Description of why no acceptable representation is available.

code string

The error code identifying this type of error.

instance string

Optional identifier for the resource.