NetworkConfiguration

public struct NetworkConfiguration

The configuration that is used by the NetworkClient to customize it’s behavior.

You almost never need to change this as most of the Networking should happen via the shared NetworkingClient instance. If you need to add new interceptors you can do that directly on the NetworkClient.

In case you really want to create a new client, start off from the NetworkConfiguration.defaultand edit it. Make sure to use a URLSessionConfiguration without cache and make sure to have at least the default interceptors.

  • Creates a network configuration with the specified parameters.

    Declaration

    Swift

    public init(sessionConfiguration: URLSessionConfiguration,
                interceptors: [RequestInterceptor],
                interceptorManagerFactory: InterceptorManagerProtocol.Type,
                queue: TealiumQueue)

    Parameters

    sessionConfiguration

    The URL session configuration to use.

    interceptors

    The request interceptors to apply.

    interceptorManagerFactory

    The factory for creating interceptor managers.

    queue

    The queue for network operations.

  • Creates a network configuration with the specified parameters and the default interceptor manager.

    Declaration

    Swift

    public init(sessionConfiguration: URLSessionConfiguration,
                interceptors: [RequestInterceptor],
                queue: TealiumQueue)

    Parameters

    sessionConfiguration

    The URL session configuration to use.

    interceptors

    The request interceptors to apply.

    queue

    The queue for network operations.

  • The default URL session configuration for network requests.

    Declaration

    Swift

    static var defaultUrlSessionConfiguration: URLSessionConfiguration { get }
  • The default set of request interceptors.

    Declaration

    Swift

    static let defaultInterceptors: [RequestInterceptor]
  • Creates and returns a new NetworkConfiguration with default parameters.

    Declaration

    Swift

    static var `default`: NetworkConfiguration { get }