public interface NSURLSessionTaskDelegate extends NSURLSessionDelegate
| Modifier and Type | Interface and Description |
|---|---|
static interface |
NSURLSessionTaskDelegate.Block_URLSessionTaskDidReceiveChallengeCompletionHandler |
static interface |
NSURLSessionTaskDelegate.Block_URLSessionTaskNeedNewBodyStream |
static interface |
NSURLSessionTaskDelegate.Block_URLSessionTaskWillBeginDelayedRequestCompletionHandler |
static interface |
NSURLSessionTaskDelegate.Block_URLSessionTaskWillPerformHTTPRedirectionNewRequestCompletionHandler |
NSURLSessionDelegate.Block_URLSessionDidReceiveChallengeCompletionHandler| Modifier and Type | Method and Description |
|---|---|
default void |
URLSessionTaskDidCompleteWithError(NSURLSession session,
NSURLSessionTask task,
NSError error)
Sent as the last message related to a specific task.
|
default void |
URLSessionTaskDidFinishCollectingMetrics(NSURLSession session,
NSURLSessionTask task,
NSURLSessionTaskMetrics metrics)
Sent when complete statistics information has been collected for the task.
|
default void |
URLSessionTaskDidReceiveChallengeCompletionHandler(NSURLSession session,
NSURLSessionTask task,
NSURLAuthenticationChallenge challenge,
NSURLSessionTaskDelegate.Block_URLSessionTaskDidReceiveChallengeCompletionHandler completionHandler)
The task has received a request specific authentication challenge.
|
default void |
URLSessionTaskDidSendBodyDataTotalBytesSentTotalBytesExpectedToSend(NSURLSession session,
NSURLSessionTask task,
long bytesSent,
long totalBytesSent,
long totalBytesExpectedToSend)
Sent periodically to notify the delegate of upload progress.
|
default void |
URLSessionTaskIsWaitingForConnectivity(NSURLSession session,
NSURLSessionTask task)
Sent when a task cannot start the network loading process because the current
network connectivity is not available or sufficient for the task's request.
|
default void |
URLSessionTaskNeedNewBodyStream(NSURLSession session,
NSURLSessionTask task,
NSURLSessionTaskDelegate.Block_URLSessionTaskNeedNewBodyStream completionHandler)
Sent if a task requires a new, unopened body stream.
|
default void |
URLSessionTaskWillBeginDelayedRequestCompletionHandler(NSURLSession session,
NSURLSessionTask task,
NSURLRequest request,
NSURLSessionTaskDelegate.Block_URLSessionTaskWillBeginDelayedRequestCompletionHandler completionHandler)
Sent when the system is ready to begin work for a task with a delayed start
time set (using the earliestBeginDate property).
|
default void |
URLSessionTaskWillPerformHTTPRedirectionNewRequestCompletionHandler(NSURLSession session,
NSURLSessionTask task,
NSHTTPURLResponse response,
NSURLRequest request,
NSURLSessionTaskDelegate.Block_URLSessionTaskWillPerformHTTPRedirectionNewRequestCompletionHandler completionHandler)
An HTTP request is attempting to perform a redirection to a different
URL.
|
URLSessionDidBecomeInvalidWithError, URLSessionDidFinishEventsForBackgroundURLSession, URLSessionDidReceiveChallengeCompletionHandlerdefault void URLSessionTaskDidCompleteWithError(NSURLSession session, NSURLSessionTask task, NSError error)
default void URLSessionTaskDidFinishCollectingMetrics(NSURLSession session, NSURLSessionTask task, NSURLSessionTaskMetrics metrics)
default void URLSessionTaskDidReceiveChallengeCompletionHandler(NSURLSession session, NSURLSessionTask task, NSURLAuthenticationChallenge challenge, NSURLSessionTaskDelegate.Block_URLSessionTaskDidReceiveChallengeCompletionHandler completionHandler)
default void URLSessionTaskDidSendBodyDataTotalBytesSentTotalBytesExpectedToSend(NSURLSession session, NSURLSessionTask task, long bytesSent, long totalBytesSent, long totalBytesExpectedToSend)
default void URLSessionTaskNeedNewBodyStream(NSURLSession session, NSURLSessionTask task, NSURLSessionTaskDelegate.Block_URLSessionTaskNeedNewBodyStream completionHandler)
default void URLSessionTaskWillPerformHTTPRedirectionNewRequestCompletionHandler(NSURLSession session, NSURLSessionTask task, NSHTTPURLResponse response, NSURLRequest request, NSURLSessionTaskDelegate.Block_URLSessionTaskWillPerformHTTPRedirectionNewRequestCompletionHandler completionHandler)
For tasks in background sessions, redirections will always be followed and this method will not be called.
default void URLSessionTaskWillBeginDelayedRequestCompletionHandler(NSURLSession session, NSURLSessionTask task, NSURLRequest request, NSURLSessionTaskDelegate.Block_URLSessionTaskWillBeginDelayedRequestCompletionHandler completionHandler)
Recommendation: only implement this delegate if tasks that have the earliestBeginDate property set may become stale and require alteration prior to starting the network load.
If a new request is specified, the allowsExpensiveNetworkAccess, allowsContrainedNetworkAccess, and allowsCellularAccess properties from the new request will not be used; the properties from the original request will continue to be used.
Canceling the task is equivalent to calling the task's cancel method; the URLSession:task:didCompleteWithError: task delegate will be called with error NSURLErrorCancelled.
default void URLSessionTaskIsWaitingForConnectivity(NSURLSession session, NSURLSessionTask task)
This delegate will be called at most one time per task, and is only called if the waitsForConnectivity property in the NSURLSessionConfiguration has been set to YES.
This delegate callback will never be called for background sessions, because the waitForConnectivity property is ignored by those sessions.