Skip to content
Documentation

IHostingSettings Interface

Aggregates all hosting-related settings for an HTTP service including URLs, proxy, CORS and compression configuration.

public interface IHostingSettings

TryRead(IConfiguration) parses a configuration section (typically {ServiceName}:Http:Hosting) into an IHostingSettings instance. The section may contain a simple comma-separated Urls value or a full Kestrel Endpoints configuration – but not both.

IHostingSettings.DEFAULT_ACCEPT_HEADER Field

Section titled “IHostingSettings.DEFAULT_ACCEPT_HEADER Field”

The default value used for the Accept request header when a request does not include one or sends an empty value.

const string DEFAULT_ACCEPT_HEADER = "application/json";

System.String

IHostingSettings.CompressionSettings Property

Section titled “IHostingSettings.CompressionSettings Property”

Gets the compression settings that control request decompression and response compression.

HAKOM.Http.Core.Net.Api.ICompressionSettings CompressionSettings { get; }

ICompressionSettings

Gets the CORS settings that define which cross-origin requests are allowed.

HAKOM.Http.Core.Net.Api.ICorsSettings CorsSettings { get; }

ICorsSettings

IHostingSettings.DefaultAcceptHeader Property

Section titled “IHostingSettings.DefaultAcceptHeader Property”

Gets the media type to use as the default Accept header for requests that do not include one or send an empty (or whitespace-only) value.

HAKOM.Http.Core.Net.Api.IDefaultAcceptHeader DefaultAcceptHeader { get; }

IDefaultAcceptHeader

The default value is application/json. Override it via the DefaultAcceptHeader setting of the service’s Http:Hosting configuration section (i.e. <service-name>:Http:Hosting:DefaultAcceptHeader). A configured value that is not a valid media type causes TryRead(IConfiguration) to fail with an InvalidDefaultAcceptHeaderException rather than being silently replaced with the default.

Gets the default hosting settings that listen on http://localhost:5000 with no proxy, CORS or compression.

static HAKOM.Http.Core.Net.Api.IHostingSettings Defaults { get; }

IHostingSettings

The configuration key under which hosting settings are expected.

static string Key { get; }

System.String

Gets the proxy settings that control forwarded header handling and path-base rewriting.

HAKOM.Http.Core.Net.Api.IProxySettings ProxySettings { get; }

IProxySettings

IHostingSettings.SupportedCultures Property

Section titled “IHostingSettings.SupportedCultures Property”

Array of cultures supported via Accept-Language header.

System.Collections.Generic.IEnumerable<System.Globalization.CultureInfo> SupportedCultures { get; }

System.Collections.Generic.IEnumerable<System.Globalization.CultureInfo>

If the array is empty, the service will not attempt to determine the culture from the Accept-Language header and will instead use the service culture for all requests.

Gets the list of URLs (or endpoints) under which the service should be accessible.

System.Collections.Generic.IReadOnlyList<string> Urls { get; }

System.Collections.Generic.IReadOnlyList<System.String>

IHostingSettings.TryRead(IConfiguration) Method

Section titled “IHostingSettings.TryRead(IConfiguration) Method”

Attempts to read hosting settings from the specified configuration.

static HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.Http.Core.Net.Api.IHostingSettings> TryRead(Microsoft.Extensions.Configuration.IConfiguration configuration);

configuration Microsoft.Extensions.Configuration.IConfiguration

The Microsoft.Extensions.Configuration.IConfiguration to read from.

HAKOM.ErrorHandling.Core.Net.Api.Result<IHostingSettings>
A Result<TValue> containing the parsed IHostingSettings or an error.

© 2026 Volue.Version v0.6.38017 November 2026