KtorLegacyNSURLSessionDelegate
class KtorLegacyNSURLSessionDelegate(challengeHandler: ChallengeHandler?) : NSObject, NSURLSessionDataDelegateProtocol
A delegate for NSURLSession that bridges it to Ktor. If users set custom session in DarwinLegacyClientEngineConfig.sessionAndDelegate, they need to register this delegate in their session. This can be done by registering it directly, extending their custom delegate from it or by calling required methods from their custom delegate.
For HTTP requests to work property, it's important that users call these functions:
URLSession:dataTask:didReceiveData:
URLSession:task:didCompleteWithError:
URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
expect open override fun performSelector(aSelector: COpaquePointer?, withObject: Any?, _withObject: Any?): Any?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveData: NSData)
open override fun URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError: NSError?)
expect open fun URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didBecomeDownloadTask: NSURLSessionDownloadTask)
expect open fun URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didBecomeStreamTask: NSURLSessionStreamTask)
expect open fun URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, willCacheResponse: NSCachedURLResponse, completionHandler: (NSCachedURLResponse?) -> Unit)
expect open fun URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveResponse: NSURLResponse, completionHandler: (NSURLSessionResponseDisposition) -> Unit)
expect open fun URLSession(session: NSURLSession, didReceiveChallenge: NSURLAuthenticationChallenge, completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Unit)
expect open fun URLSession(session: NSURLSession, task: NSURLSessionTask, needNewBodyStream: (NSInputStream?) -> Unit)
expect open fun URLSession(session: NSURLSession, task: NSURLSessionTask, didReceiveInformationalResponse: NSHTTPURLResponse)
expect open fun URLSession(session: NSURLSession, task: NSURLSessionTask, didFinishCollectingMetrics: NSURLSessionTaskMetrics)
expect open fun URLSession(session: NSURLSession, task: NSURLSessionTask, needNewBodyStreamFromOffset: int64_t, completionHandler: (NSInputStream?) -> Unit)
expect open fun URLSession(session: NSURLSession, task: NSURLSessionTask, willBeginDelayedRequest: NSURLRequest, completionHandler: (NSURLSessionDelayedRequestDisposition, NSURLRequest?) -> Unit)
expect open fun URLSession(session: NSURLSession, task: NSURLSessionTask, didSendBodyData: int64_t, totalBytesSent: int64_t, totalBytesExpectedToSend: int64_t)
open override fun URLSession(session: NSURLSession, task: NSURLSessionTask, didReceiveChallenge: NSURLAuthenticationChallenge, completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Unit)
Handle challenge.
open override fun URLSession(session: NSURLSession, task: NSURLSessionTask, willPerformHTTPRedirection: NSHTTPURLResponse, newRequest: NSURLRequest, completionHandler: (NSURLRequest?) -> Unit)
Disable embedded redirects.
Link copied to clipboard