Skip to main content

IIntegrationSettings

Namespace: RA.Utilities.Integrations.Abstractions

Its primary purpose is to ensure that all settings classes used to configure HttpClient instances through the RA.Utilities.Integrations package adhere to a standardized set of properties.

This standardization is crucial for:

1. Consistency:

It guarantees that every integration, regardless of its specific API, will expose common configuration elements like a base URL, timeout, and media type.

2. Reusability:

Components and extension methods (like AddHttpClientIntegration) can operate on any object implementing IIntegrationSettings, making them generic and reusable across different integrations.

3. Decoupling:

It allows the integration infrastructure to depend on an abstract contract rather than concrete settings classes, promoting loose coupling and easier maintenance.

4. Clarity:

It clearly defines the essential parameters needed to set up an HttpClient for external API communication.

Properties

This interface defines a standardized contract for configuration classes that provide an API key for authentication.

PropertyTypeDescription
BaseUrlUriThe base address for all requests made by the HttpClient. This is a required property.
UseProxyboolA flag to determine if the HttpClient should route requests through a configured proxy. Defaults to false.
TimeoutdoubleThe number of seconds to wait for a response before the request times out. The default is 100 seconds.
MediaTypestringThe media type (e.g., "application/json") used for the Content-Type header in requests with a body.
EncodingstringThe character encoding (e.g., "utf-8") used with the MediaType to form the complete Content-Type header.