How to use URLSessionStreamTask with URLSession for chunked-encoding transfer
问题 I am trying to connect to the Twitter streaming API endpoint. It looks like URLSession supports streaming via URLSessionStreamTask , however I can't figure out how to use the API. I have not been able to find any sample code either. I tried testing the following, but there is no network traffic recorded: let session = URLSession(configuration: .default, delegate: self, delegateQueue: nil) let stream = session.streamTask(withHostName: "https://stream.twitter.com/1.1/statuses/sample.json", port