An array of extra protocol subclasses that handle requests in a session.
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
The objects in this array are
Class objects corresponding to custom
URLProtocol subclasses that you define. URL session objects support a number of common networking protocols by default. Use this array to extend the default set of common networking protocols available for use by a session with one or more custom protocols that you define.
Prior to handling a request, the
URLSession object searches the default protocols first and then checks your custom protocols until it finds one capable of handling the specified request. It uses the protocol whose
can class method returns
true, indicating that the class is capable of handling the specified request.
The default value is an empty array.