Networking Layer
Networking Layer is responsible for handling all network communication, providing a robust, flexible, and testable interface for making API requests, handling responses, managing errors, and processing data.
The key features of this networking layer include:
- A centralized OCNetworkManager for executing various types of network requests (data, decodable objects, downloads).
- Protocol-oriented design (OCNetworkManagerProtocol, OCRequestable, URLSessionProtocol, OCNetworkInterceptorProtocol) promoting flexibility and testability.
- An interception mechanism (OCNetworkInterceptorProtocol) allowing modification of requests and responses for tasks like authentication, logging, or custom error handling.
- A detailed error handling system with a custom OCNetworkError enum.
- Support for request retries with configurable limits and delays.
- Management of download tasks, including cancellation of active downloads.