KtorLegacyNSURLSessionDelegate

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:

Constructors

Link copied to clipboard
constructor(challengeHandler: ChallengeHandler?)

Functions

Link copied to clipboard
open fun URLSession(session: <Error class: unknown class>, dataTask: <Error class: unknown class>, didReceiveData: <Error class: unknown class>)
open fun URLSession(session: <Error class: unknown class>, task: <Error class: unknown class>, didCompleteWithError: <Error class: unknown class>?)

open fun URLSession(session: <Error class: unknown class>, task: <Error class: unknown class>, didReceiveChallenge: <Error class: unknown class>, completionHandler: (<Error class: unknown class>, <Error class: unknown class>?) -> Unit)

Handle challenge.

open fun URLSession(session: <Error class: unknown class>, task: <Error class: unknown class>, willPerformHTTPRedirection: <Error class: unknown class>, newRequest: <Error class: unknown class>, completionHandler: (<Error class: unknown class>?) -> Unit)

Disable embedded redirects.