Cuemon.AspNetCore.Http Namespace
Handle structured HTTP errors, throttling, sentinel validation, and header manipulation in ASP.NET Core applications. Use this namespace when you need status-code exceptions, request throttling, API key validation, or HTTP header utilities. Start with status-code exception classes such as BadRequestException, ForbiddenException, or NotFoundException for standard HTTP error responses, or sentinel middleware like ApiKeySentinelMiddleware for request validation.
Availability: .NET 10 and .NET 9
Complements: Microsoft.AspNetCore.Http namespace 🔗
Related: Cuemon.Extensions.AspNetCore.Http namespace 📘
Extension Members
| Type | Ext | Methods |
|---|---|---|
| IDecorator |
⬇️ | InvokeThrottlerSentinelAsync, InvokeUserAgentSentinelAsync, InvokeApiKeySentinelAsync, WriteExceptionDescriptorResponseAsync |
| IDecorator |
⬇️ | IsGetOrHeadMethod, IsClientSideResourceCached |
| IDecorator |
⬇️ | AddOrUpdateEntityTagHeader, AddOrUpdateLastModifiedHeader |
| IDecorator |
⬇️ | AddResponseHeaders<T> |
| IDecorator |
⬇️ | AddResponseHeaders<T> |
| IDecorator |
⬇️ | AddRange, AddOrUpdateHeader, AddOrUpdateHeaders |
| IDecorator |
⬇️ | IsInformationStatusCode, IsSuccessStatusCode, IsRedirectionStatusCode, IsNotModifiedStatusCode, IsClientErrorStatusCode, IsServerErrorStatusCode |
Classes
- BadRequestException
The exception that is thrown when the server could not understand the request due to invalid syntax.
- ConflictException
The exception that is thrown when a request conflicts with the current state of the server.
- ForbiddenException
The exception that is thrown when the client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401, the client's identity is known to the server.
- GoneException
The exception that is thrown when the requested content has been permanently deleted from server, with no forwarding address.
- HeaderDictionaryDecoratorExtensions
Extension methods for the IHeaderDictionary interface hidden behind the IDecorator<T> interface.
- HttpContextDecoratorExtensions
Extension methods for the HttpContext class hidden behind the IDecorator<T> interface. This API supports the product infrastructure and is not intended to be used directly from your code.
- HttpRequestDecoratorExtensions
Extension methods for the HttpRequest class hidden behind the IDecorator<T> interface.
- HttpResponseDecoratorExtensions
Extension methods for the HttpResponse class hidden behind the IDecorator<T> interface.
- HttpStatusCodeException
Provides a base-class for exceptions based on an HTTP status code.
- HttpStatusCodeExceptionDecoratorExtensions
Extension methods for the HttpStatusCodeException class hidden behind the IDecorator<T> interface.
- Int32DecoratorExtensions
Extension methods for the int struct hidden behind the IDecorator<T> interface.
- InternalServerErrorException
The exception that is thrown when the server has encountered a situation it does not know how to handle.
- MethodNotAllowedException
The exception that is thrown when the request method is known by the server but has been disabled and cannot be used.
- NotAcceptableException
The exception that is thrown when the web server, after performing server-driven content negotiation, does not find any content that conforms to the criteria given by the user agent.
- NotFoundException
The exception that is thrown when the server can not find the requested resource.
- PayloadTooLargeException
The exception that is thrown when the request entity is larger than limits defined by server.
- PreconditionFailedException
The exception that is thrown when the client has indicated preconditions in its headers which the server does not meet.
- PreconditionRequiredException
The exception that is thrown when the origin server requires the request to be conditional.
- TooManyRequestsException
The exception that is thrown when the user has sent too many requests in a given amount of time ("rate limiting").
- UnauthorizedException
The exception that is thrown when the requirements of an HTTP WWW-Authenticate header is not meet.
- UnsupportedMediaTypeException
The exception that is thrown when the media format of the requested data is not supported by the server, so the server is rejecting the request.