HAKOM.Versioning.Http.Net.Api Namespace
Contains the public API surface of the HTTP versioning module.
Remarks
Section titled “Remarks”This namespace provides the interfaces, controllers and extension methods required to add media-type-based API versioning to an ASP.NET Core HTTP service:
- IVersionedServiceInformation — Describes a versioned HTTP API, exposing the current service version and all supported API versions.
- IUnacceptableHandler — Handles requests whose
Acceptheader does not match any supported API version. - IUnsupportedVersionStatusCode — Defines the HTTP status code returned when the requested
api-versionis not supported by the endpoint. - VersionInformationController — An API controller that exposes a root endpoint returning IVersionedServiceInformation as JSON.
A client requests a specific API version by including the api-version
parameter in the Accept header:
HttpRequestMessage request = new(HttpMethod.Get, "/timeseries");request.Headers.Accept.Add( MediaTypeWithQualityHeaderValue.Parse("application/json; api-version=4.3.0"));| Classes | |
|---|---|
| VersionInformationController | Provides version-related information about an HTTP API. |
| Interfaces | |
|---|---|
| IUnacceptableHandler | Handler for requests that are not acceptable based on the given “Accept”-header. |
| IUnsupportedVersionStatusCode | Used to define the type of status code that should be returned if a request is made with an api-version media type parameter that the endpoint does not support. When calling SelectEndpointsByNamespaceAndMediaTypeVersion(this IMvcBuilder, HttpStatusCode) a default implementation of this interface is registered as a singleton causing these requests to fail with the given status code. |
| IVersionedServiceInformation | Describes a versioned HTTP API. |
Was this page helpful?Thanks for your feedback!