KtorLegacyNSURLSessionDelegate

class KtorLegacyNSURLSessionDelegate(challengeHandler: ChallengeHandler?) : <ERROR CLASS> ERROR CLASS: Symbol not found for NSObject, <ERROR CLASS> ERROR CLASS: Symbol not found for NSURLSessionDataDelegateProtocol(source)

Deprecated

DarwinLegacy engine is deprecated. Consider using KtorNSURLSessionDelegate from Darwin engine instead.

Replace with

import io.ktor.client.engine.darwin.KtorNSURLSessionDelegate
KtorNSURLSessionDelegate

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:

Report a problem

Constructors

Link copied to clipboard
constructor(challengeHandler: ChallengeHandler?)

Functions

Link copied to clipboard
open override fun URLSession(session: ERROR CLASS: Symbol not found for NSURLSession, dataTask: ERROR CLASS: Symbol not found for NSURLSessionDataTask, didReceiveData: ERROR CLASS: Symbol not found for NSData)
open override fun URLSession(session: ERROR CLASS: Symbol not found for NSURLSession, task: ERROR CLASS: Symbol not found for NSURLSessionTask, didCompleteWithError: ERROR CLASS: Symbol not found for NSError??)

open override fun URLSession(session: ERROR CLASS: Symbol not found for NSURLSession, task: ERROR CLASS: Symbol not found for NSURLSessionTask, didReceiveChallenge: ERROR CLASS: Symbol not found for NSURLAuthenticationChallenge, completionHandler: (ERROR CLASS: Symbol not found for NSURLSessionAuthChallengeDisposition, ERROR CLASS: Symbol not found for NSURLCredential??) -> Unit)

Handle challenge.

open override fun URLSession(session: ERROR CLASS: Symbol not found for NSURLSession, task: ERROR CLASS: Symbol not found for NSURLSessionTask, willPerformHTTPRedirection: ERROR CLASS: Symbol not found for NSHTTPURLResponse, newRequest: ERROR CLASS: Symbol not found for NSURLRequest, completionHandler: (ERROR CLASS: Symbol not found for NSURLRequest??) -> Unit)

Disable embedded redirects.