# NetworkConfiguration Class

    public class NetworkConfiguration : NSObject, NSCopying, Codable

Discussion: Apple uses predefined network sessions called URLSession. There is no way to create a dedicated URLSession for each Request. If ‘NetworkConfiguration’ is updated it will affect the whole URLSession, which is shared for all the HTTP/S requests in ‘NetworkEngine’.

- `httpAdditionalHeaders`

  A dictionary of additional headers to send with requests.

  #### Declaration

  Swift

      public var httpAdditionalHeaders: [String : String]

- `allowsCellularAccess`

  A Boolean value that determines whether connections should be made over a cellular network. The value is assigned on the URLSession-level and on the URLRequest-level

  #### Declaration

  Swift

      public var allowsCellularAccess: Bool

- `timeoutIntervalForResourceMs`

  The maximum amount of time that a resource request should be allowed to take. The value is assigned on the URLSession-level and on the URLRequest-level

  #### Declaration

  Swift

      public var timeoutIntervalForResourceMs: Double

- `timeoutIntervalForDrmAcquisitionMs`

  The drm license requests dedicated timeout. By default, the timeout is set to 0.0, which means that the request will not forcefully timeout.

  #### Declaration

  Swift

      public var timeoutIntervalForDrmAcquisitionMs: Double

- `waitsForConnectivity`

  A Boolean value that indicates whether the session should wait for connectivity to become available, or fail immediately.

  #### Declaration

  Swift

      public var waitsForConnectivity: Bool

- `init(from:)`

  #### Declaration

  Swift

      public required init(from decoder: Decoder) throws

- `init(httpAdditionalHeaders:allowsCellularAccess:timeoutIntervalForResourceMs:timeoutIntervalForDrmAcquisitionMs:waitsForConnectivity:)`

  Creates a network configuration with explicit values.

  #### Declaration

  Swift

      public init(
          httpAdditionalHeaders: [String: String] = [:],
          allowsCellularAccess: Bool = Defaults.allowsCellularAccess,
          timeoutIntervalForResourceMs: Double = Defaults.timeoutIntervalForResource,
          timeoutIntervalForDrmAcquisitionMs: Double = Defaults.timeoutIntervalForDrmAcquisition,
          waitsForConnectivity: Bool = Defaults.waitsForConnectivity
      )

  #### Parameters

  `httpAdditionalHeaders` | Extra HTTP headers attached to all outgoing requests.
  `allowsCellularAccess` | Whether requests may use cellular transport.
  `timeoutIntervalForResourceMs` | Timeout for non-DRM requests in milliseconds.
  `timeoutIntervalForDrmAcquisitionMs` | Timeout for DRM requests in milliseconds.
  `waitsForConnectivity` | Whether requests should wait for connectivity instead of failing fast.