Skip to content

HostSettingsManager

Manages host-specific settings for HTTP requests based on hostnames. The HostSettingsManager is a powerful tool for fine-tuning HTTP request and connection behaviors on a per-host basis. It enables you to define custom settings for specific hostnames while maintaining default settings for all other hosts. This level of granularity allows you to optimize and customize HTTP requests for different endpoints within your application.

Remarks:

When host-specific settings are not found for a given host variant, the default HostSettings associated with the "*" host will be returned.

Methods:

HostSettings AddDefault(Uri)

Adds default settings for the host part of the specified URI. This is equivalent to calling Add with the a new HostSettings.

HostSettings AddDefault(String)

Adds default settings for the the specified host name. This is equivalent to calling Add with the a new HostSettings.

HostSettings Add(Uri, HostSettings)

Adds host-specific settings for the host part of the specified URI.

HostSettings Add(String, HostSettings)

Adds host-specific settings for the specified hostname.

HostSettings Get(HostVariant)

Gets HostSettings for the host part of the specified HostVariant. Returns the default settings associated with "*" when not found.

HostSettings Get(HostKey)

Gets HostSettings for the host part of the specified HostKey. Returns the default settings associated with "*" when not found.

HostSettings Get(Uri)

Gets HostSettings for the host part of the specified Uri. Returns the default settings associated with "*" when not found.

HostSettings Get(String)

Gets HostSettings for the host part of the specified hostname. Returns the default settings associated with "*" when not found.

Void Clear()

Clears all host-specific settings and resetting the default ("*") with default values.

Comments