A URL session task that is stream-based.
- iOS 9.0+
- macOS 10.11+
- tvOS 9.0+
- watchOS 2.0+
URLSession class provides an interface a TCP/IP connection created via
URLSession. Tasks may be created from an
URLSession using the
stream methods. They may also created as a result of an
URLSession being upgraded via the HTTP
Upgrade: response header and appropriate use of the
http option of
URLSession object perform asynchronous reads and writes, which are enqueued and executed serially, calling a handler upon completion being on the session delegate queue. If the task is canceled, all enqueued reads and writes will call their completion handlers with an appropriate error.