Up

# NSURLSession documentation

### Authors

Daniel Ferreira (`dtf@stanford.edu`)
Richard Frith-Macdonald (`richard@brainstorm.co.uk`)

Date: Generated at 2025-02-13 06:02:40 +0000

Copyright: (C) 2017-2023 Free Software Foundation, Inc.

### Contents -

1. Software documentation for the NSURLSession class
2. Software documentation for the NSURLSessionConfiguration class
3. Software documentation for the NSURLSessionDataTask class
4. Software documentation for the NSURLSessionDownloadTask class
5. Software documentation for the NSURLSessionStreamTask class
6. Software documentation for the NSURLSessionTask class
7. Software documentation for the NSURLSessionUploadTask class
8. Software documentation for the NSURLSession(NSURLSessionAsynchronousConvenience) category
9. Software documentation for the NSURLSessionDataDelegate protocol
10. Software documentation for the NSURLSessionDelegate protocol
11. Software documentation for the NSURLSessionDownloadDelegate protocol
12. Software documentation for the NSURLSessionTaskDelegate protocol

# Software documentation for the NSURLSession class

## NSURLSession : NSObject

> Declared in:
>   Foundation/NSURLSession.h

Availability: MacOS-X 10.9.0
NSURLSession is a replacement API for NSURLConnection. It provides options that affect the policy of, and various aspects of the mechanism by which NSURLRequest objects are retrieved from the network.
An NSURLSession may be bound to a delegate object. The delegate is invoked for certain events during the lifetime of a session. NSURLSession instances are threadsafe. An NSURLSession creates NSURLSessionTask objects which represent the action of a resource being loaded. NSURLSessionTask objects are always created in a suspended state and must be sent the -resume message before they will execute. Subclasses of NSURLSessionTask are used to syntactically differentiate between data and file downloads. An NSURLSessionDataTask receives the resource as a series of calls to the URLSession:dataTask:didReceiveData: delegate method. This is type of task most commonly associated with retrieving objects for immediate parsing by the consumer.

Instance Variables
Method summary

- -dataTaskWithRequest:completionHandler:
- -dataTaskWithURL:completionHandler:
- -downloadTaskWithRequest:completionHandler:
- -downloadTaskWithResumeData:completionHandler:
- -downloadTaskWithURL:completionHandler:
- -uploadTaskWithRequest:fromData:completionHandler:
- -uploadTaskWithRequest:fromFile:completionHandler:
- +sessionWithConfiguration:
- +sessionWithConfiguration:delegate:delegateQueue:
- +sharedSession
- -configuration
- -dataTaskWithRequest:
- -dataTaskWithURL:
- -delegate
- -delegateQueue
- -downloadTaskWithRequest:
- -downloadTaskWithResumeData:
- -downloadTaskWithURL:
- -finishTasksAndInvalidate
- -getAllTasksWithCompletionHandler:
- -getTasksWithCompletionHandler:
- -invalidateAndCancel
- -sessionDescription
- -setSessionDescription:
- -uploadTaskWithRequest:fromData:
- -uploadTaskWithRequest:fromFile:
- -uploadTaskWithStreamedRequest:

### sessionWithConfiguration:

+ (NSURLSession*) sessionWithConfiguration: (NSURLSessionConfiguration*)configuration;
Availability: MacOS-X 10.9.0
Description forthcoming.

### sessionWithConfiguration: delegate: delegateQueue:

+ (NSURLSession*) sessionWithConfiguration: (NSURLSessionConfiguration*)configuration delegate: (id<NSURLSessionDelegate>)delegate delegateQueue: (NSOperationQueue*)queue;
Availability: MacOS-X 10.9.0
Description forthcoming.

### sharedSession

+ (NSURLSession*) sharedSession;
Availability: MacOS-X 10.9.0
Description forthcoming.

### configuration

- (NSURLSessionConfiguration*) configuration;
Availability: MacOS-X 10.9.0
Description forthcoming.

### dataTaskWithRequest:

- (NSURLSessionDataTask*) dataTaskWithRequest: (NSURLRequest*)request;
Availability: MacOS-X 10.9.0
Description forthcoming.

### dataTaskWithURL:

- (NSURLSessionDataTask*) dataTaskWithURL: (NSURL*)url;
Availability: MacOS-X 10.9.0
Description forthcoming.

### delegate

- (id<NSURLSessionDelegate>) delegate;
Availability: MacOS-X 10.9.0
Description forthcoming.

### delegateQueue

- (NSOperationQueue*) delegateQueue;
Availability: MacOS-X 10.9.0
Description forthcoming.

### downloadTaskWithRequest:

- (NSURLSessionDownloadTask*) downloadTaskWithRequest: (NSURLRequest*)request;
Availability: MacOS-X 10.9.0
Description forthcoming.

### downloadTaskWithResumeData:

- (NSURLSessionDownloadTask*) downloadTaskWithResumeData: (NSData*)resumeData;
Availability: MacOS-X 10.9.0
Description forthcoming.

### downloadTaskWithURL:

- (NSURLSessionDownloadTask*) downloadTaskWithURL: (NSURL*)url;
Availability: MacOS-X 10.9.0
Description forthcoming.

### finishTasksAndInvalidate

- (void) finishTasksAndInvalidate;
Availability: MacOS-X 10.9.0
Description forthcoming.

### getAllTasksWithCompletionHandler:

- (void) getAllTasksWithCompletionHandler: (IC_CLASS(NSArray*tasks))completionHandler;
Availability: MacOS-X 10.9.0
Description forthcoming.

### getTasksWithCompletionHandler:

- (void) getTasksWithCompletionHandler: (dTasks*downloadTasks))completionHandler;
Availability: MacOS-X 10.9.0
Description forthcoming.

### invalidateAndCancel

- (void) invalidateAndCancel;
Availability: MacOS-X 10.9.0
Description forthcoming.

### sessionDescription

- (NSString*) sessionDescription;
Availability: MacOS-X 10.9.0
Description forthcoming.

### setSessionDescription:

- (void) setSessionDescription: (NSString*)sessionDescription;
Availability: MacOS-X 10.9.0
Description forthcoming.

### uploadTaskWithRequest: fromData:

- (NSURLSessionUploadTask*) uploadTaskWithRequest: (NSURLRequest*)request fromData: (NSData*)bodyData;
Availability: MacOS-X 10.9.0
Description forthcoming.

### uploadTaskWithRequest: fromFile:

- (NSURLSessionUploadTask*) uploadTaskWithRequest: (NSURLRequest*)request fromFile: (NSURL*)fileURL;
Availability: MacOS-X 10.9.0
Description forthcoming.

### uploadTaskWithStreamedRequest:

- (NSURLSessionUploadTask*) uploadTaskWithStreamedRequest: (NSURLRequest*)request;
Availability: MacOS-X 10.9.0
Description forthcoming.

## Instance Variables for NSURLSession Class

### _configuration

@protected NSURLSessionConfiguration* _configuration;
Availability: MacOS-X 10.9.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _delegate

@protected id<NSURLSessionDelegate> _delegate;
Availability: MacOS-X 10.9.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _delegateQueue

@protected NSOperationQueue* _delegateQueue;
Availability: MacOS-X 10.9.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _multiHandle

@protected GSMultiHandle* _multiHandle;
Availability: MacOS-X 10.9.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _sessionDescription

@protected NSString* _sessionDescription;
Availability: MacOS-X 10.9.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

# Software documentation for the NSURLSessionConfiguration class

## NSURLSessionConfiguration : NSObject

> Declared in:
>   Foundation/NSURLSession.h

> Conforms to:
>   NSCopying

Availability: MacOS-X 10.9.0
Description forthcoming.

Instance Variables
Method summary

- +backgroundSessionConfigurationWithIdentifier:
- +defaultSessionConfiguration
- +ephemeralSessionConfiguration
- -HTTPAdditionalHeaders
- -HTTPCookieAcceptPolicy
- -HTTPCookieStorage
- -HTTPMaximumConnectionLifetime
- -HTTPMaximumConnectionsPerHost
- -HTTPShouldSetCookies
- -HTTPShouldUsePipelining
- -URLCache
- -URLCredentialStorage
- -configureRequest:
- -identifier
- -protocolClasses
- -requestCachePolicy
- -setHTTPAdditionalHeaders:
- -setHTTPCookieAcceptPolicy:
- -setHTTPCookieStorage:
- -setHTTPMaximumConnectionLifetime:
- -setHTTPMaximumConnectionsPerHost:
- -setHTTPShouldSetCookies:
- -setHTTPShouldUsePipelining:
- -setRequestCachePolicy:
- -setURLCache:
- -setURLCredentialStorage:

### backgroundSessionConfigurationWithIdentifier:

+ (NSURLSessionConfiguration*) backgroundSessionConfigurationWithIdentifier: (NSString*)identifier;
Availability: MacOS-X 10.9.0
Description forthcoming.

### defaultSessionConfiguration

+ (NSURLSessionConfiguration*) defaultSessionConfiguration;
Availability: MacOS-X 10.9.0
Description forthcoming.

### ephemeralSessionConfiguration

+ (NSURLSessionConfiguration*) ephemeralSessionConfiguration;
Availability: MacOS-X 10.9.0
Description forthcoming.

### HTTPAdditionalHeaders

- (NSDictionary*) HTTPAdditionalHeaders;
Availability: MacOS-X 10.9.0
Description forthcoming.

### HTTPCookieAcceptPolicy

- (NSHTTPCookieAcceptPolicy) HTTPCookieAcceptPolicy;
Availability: MacOS-X 10.9.0
Description forthcoming.

### HTTPCookieStorage

- (NSHTTPCookieStorage*) HTTPCookieStorage;
Availability: MacOS-X 10.9.0
Description forthcoming.

### HTTPMaximumConnectionLifetime

- (NSInteger) HTTPMaximumConnectionLifetime;
Availability: MacOS-X 10.9.0
Permits a session to be configured so that older connections are reused. A value of zero or less uses the default behavior where connections are reused as long as they are not older than 118 seconds, which is reasonable for the vast majority if situations.

### HTTPMaximumConnectionsPerHost

- (NSInteger) HTTPMaximumConnectionsPerHost;
Availability: MacOS-X 10.9.0
Description forthcoming.

### HTTPShouldSetCookies

- (BOOL) HTTPShouldSetCookies;
Availability: MacOS-X 10.9.0
Description forthcoming.

### HTTPShouldUsePipelining

- (BOOL) HTTPShouldUsePipelining;
Availability: MacOS-X 10.9.0
Description forthcoming.

### URLCache

- (NSURLCache*) URLCache;
Availability: MacOS-X 10.9.0
Description forthcoming.

### URLCredentialStorage

- (NSURLCredentialStorage*) URLCredentialStorage;
Availability: MacOS-X 10.9.0
Description forthcoming.

### configureRequest:

- (NSURLRequest*) configureRequest: (NSURLRequest*)request;
Availability: MacOS-X 10.9.0
Description forthcoming.

### identifier

- (NSString*) identifier;
Availability: MacOS-X 10.9.0
Description forthcoming.

### protocolClasses

- (NSArray*) protocolClasses;
Availability: MacOS-X 10.9.0
Description forthcoming.

### requestCachePolicy

- (NSURLRequestCachePolicy) requestCachePolicy;
Availability: MacOS-X 10.9.0
Description forthcoming.

### setHTTPAdditionalHeaders:

- (void) setHTTPAdditionalHeaders: (NSDictionary*)headers;
Availability: MacOS-X 10.9.0
Description forthcoming.

### setHTTPCookieAcceptPolicy:

- (void) setHTTPCookieAcceptPolicy: (NSHTTPCookieAcceptPolicy)policy;
Availability: MacOS-X 10.9.0
Description forthcoming.

### setHTTPCookieStorage:

- (void) setHTTPCookieStorage: (NSHTTPCookieStorage*)storage;
Availability: MacOS-X 10.9.0
Description forthcoming.

### setHTTPMaximumConnectionLifetime:

- (void) setHTTPMaximumConnectionLifetime: (NSInteger)n;
Availability: MacOS-X 10.9.0
Description forthcoming.

### setHTTPMaximumConnectionsPerHost:

- (void) setHTTPMaximumConnectionsPerHost: (NSInteger)n;
Availability: MacOS-X 10.9.0
Description forthcoming.

### setHTTPShouldSetCookies:

- (void) setHTTPShouldSetCookies: (BOOL)flag;
Availability: MacOS-X 10.9.0
Description forthcoming.

### setHTTPShouldUsePipelining:

- (void) setHTTPShouldUsePipelining: (BOOL)flag;
Availability: MacOS-X 10.9.0
Description forthcoming.

### setRequestCachePolicy:

- (void) setRequestCachePolicy: (NSURLRequestCachePolicy)policy;
Availability: MacOS-X 10.9.0
Description forthcoming.

### setURLCache:

- (void) setURLCache: (NSURLCache*)cache;
Availability: MacOS-X 10.9.0
Description forthcoming.

### setURLCredentialStorage:

- (void) setURLCredentialStorage: (NSURLCredentialStorage*)storage;
Availability: MacOS-X 10.9.0
Description forthcoming.

## Instance Variables for NSURLSessionConfiguration Class

### _HTTPAdditionalHeaders

@protected NSDictionary* _HTTPAdditionalHeaders;
Availability: MacOS-X 10.9.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _HTTPCookieAcceptPolicy

@protected NSHTTPCookieAcceptPolicy _HTTPCookieAcceptPolicy;
Availability: MacOS-X 10.9.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _HTTPCookieStorage

@protected NSHTTPCookieStorage* _HTTPCookieStorage;
Availability: MacOS-X 10.9.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _HTTPMaximumConnectionLifetime

@protected NSInteger _HTTPMaximumConnectionLifetime;
Availability: MacOS-X 10.9.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _HTTPMaximumConnectionsPerHost

@protected NSInteger _HTTPMaximumConnectionsPerHost;
Availability: MacOS-X 10.9.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _HTTPShouldSetCookies

@protected BOOL _HTTPShouldSetCookies;
Availability: MacOS-X 10.9.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _HTTPShouldUsePipelining

@protected BOOL _HTTPShouldUsePipelining;
Availability: MacOS-X 10.9.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _URLCache

@protected NSURLCache* _URLCache;
Availability: MacOS-X 10.9.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _URLCredentialStorage

@protected NSURLCredentialStorage* _URLCredentialStorage;
Availability: MacOS-X 10.9.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _identifier

@protected NSString* _identifier;
Availability: MacOS-X 10.9.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _protocolClasses

@protected NSArray* _protocolClasses;
Availability: MacOS-X 10.9.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _requestCachePolicy

@protected NSURLRequestCachePolicy _requestCachePolicy;
Availability: MacOS-X 10.9.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

# Software documentation for the NSURLSessionDataTask class

## NSURLSessionDataTask : NSURLSessionTask

> Declared in:
>   Foundation/NSURLSession.h

Availability: MacOS-X 10.9.0
Description forthcoming.

# Software documentation for the NSURLSessionDownloadTask class

## NSURLSessionDownloadTask : NSURLSessionTask

> Declared in:
>   Foundation/NSURLSession.h

Availability: MacOS-X 10.9.0
Description forthcoming.

# Software documentation for the NSURLSessionStreamTask class

## NSURLSessionStreamTask : NSURLSessionTask

> Declared in:
>   Foundation/NSURLSession.h

Availability: MacOS-X 10.11.0
Description forthcoming.

# Software documentation for the NSURLSessionTask class

## NSURLSessionTask : NSObject

> Declared in:
>   Foundation/NSURLSession.h

> Conforms to:
>   NSCopying

Availability: MacOS-X 10.9.0
Description forthcoming.

Instance Variables
Method summary

- -cancel
- -countOfBytesExpectedToReceive
- -countOfBytesExpectedToSend
- -countOfBytesReceived
- -countOfBytesSent
- -currentRequest
- -error
- -originalRequest
- -priority
- -response
- -resume
- -session
- -setPriority:
- -setResponse:
- -setTaskDescription:
- -state
- -suspend
- -taskDescription
- -taskIdentifier

### cancel

- (void) cancel;
Availability: MacOS-X 10.9.0
Description forthcoming.

### countOfBytesExpectedToReceive

- (int64_t) countOfBytesExpectedToReceive;
Availability: MacOS-X 10.9.0
Description forthcoming.

### countOfBytesExpectedToSend

- (int64_t) countOfBytesExpectedToSend;
Availability: MacOS-X 10.9.0
Description forthcoming.

### countOfBytesReceived

- (int64_t) countOfBytesReceived;
Availability: MacOS-X 10.9.0
Description forthcoming.

### countOfBytesSent

- (int64_t) countOfBytesSent;
Availability: MacOS-X 10.9.0
Description forthcoming.

### currentRequest

- (NSURLRequest*) currentRequest;
Availability: MacOS-X 10.9.0
Description forthcoming.

### error

- (NSError*) error;
Availability: MacOS-X 10.9.0
Description forthcoming.

### originalRequest

- (NSURLRequest*) originalRequest;
Availability: MacOS-X 10.9.0
Description forthcoming.

### priority

- (float) priority;
Availability: MacOS-X 10.9.0
Description forthcoming.

### response

- (NSURLResponse*) response;
Availability: MacOS-X 10.9.0
Description forthcoming.

### resume

- (void) resume;
Availability: MacOS-X 10.9.0
Description forthcoming.

### session

- (NSURLSession*) session;
Availability: MacOS-X 10.9.0
Description forthcoming.

### setPriority:

- (void) setPriority: (float)priority;
Availability: MacOS-X 10.9.0
Description forthcoming.

### setResponse:

- (void) setResponse: (NSURLResponse*)response;
Availability: MacOS-X 10.9.0
Description forthcoming.

### setTaskDescription:

- (void) setTaskDescription: (NSString*)taskDescription;
Availability: MacOS-X 10.9.0
Description forthcoming.

### state

- (NSURLSessionTaskState) state;
Availability: MacOS-X 10.9.0
Description forthcoming.

### suspend

- (void) suspend;
Availability: MacOS-X 10.9.0
Description forthcoming.

### taskDescription

- (NSString*) taskDescription;
Availability: MacOS-X 10.9.0
Description forthcoming.

### taskIdentifier

- (NSUInteger) taskIdentifier;
Availability: MacOS-X 10.9.0
Description forthcoming.

## Instance Variables for NSURLSessionTask Class

### _countOfBytesExpectedToReceive

@protected int64_t _countOfBytesExpectedToReceive;
Availability: MacOS-X 10.9.0
number of byte bytes we expect to receive, usually derived from the Content-Length header of an HTTP response.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _countOfBytesExpectedToSend

@protected int64_t _countOfBytesExpectedToSend;
Availability: MacOS-X 10.9.0
number of body bytes we expect to send, derived from the Content-Length of the HTTP request
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _countOfBytesReceived

@protected int64_t _countOfBytesReceived;
Availability: MacOS-X 10.9.0
number of body bytes already received
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _countOfBytesSent

@protected int64_t _countOfBytesSent;
Availability: MacOS-X 10.9.0
number of body bytes already sent
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _currentRequest

@protected NSURLRequest* _currentRequest;
Availability: MacOS-X 10.9.0
The request this task is currently handling. This may differ from originalRequest due to http server redirection
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _dataCompletionHandler

@protected void(^ _dataCompletionHandler;
Availability: MacOS-X 10.9.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _downloadCompletionHandler

@protected void(^ _downloadCompletionHandler;
Availability: MacOS-X 10.9.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _error

@protected NSError* _error;
Availability: MacOS-X 10.9.0
The error, if any, delivered via -URLSession:task:didCompleteWithError: This is `nil` until an error has occured.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _knownBody

@protected GSURLSessionTaskBody* _knownBody;
Availability: MacOS-X 10.9.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _originalRequest

@protected NSURLRequest* _originalRequest;
Availability: MacOS-X 10.9.0
The request this task was created to handle.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _response

@protected NSURLResponse* _response;
Availability: MacOS-X 10.9.0
The response to the current request, which may be `nil` if no response has been received
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _state

@protected NSURLSessionTaskState _state;
Availability: MacOS-X 10.9.0
The current state of the task within the session.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _suspendCount

@protected NSUInteger _suspendCount;
Availability: MacOS-X 10.9.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _taskDescription

@protected NSString* _taskDescription;
Availability: MacOS-X 10.9.0
a description of the current task for diagnostic purposes
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _taskIdentifier

@protected NSUInteger _taskIdentifier;
Availability: MacOS-X 10.9.0
An identifier for this task, assigned by and unique to the owning session
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _workQueue

@protected void* _workQueue;
Availability: MacOS-X 10.9.0
The dispatch queue used to handle this request/response. This is actualy a libdispatch queue of type dispatch_queue_t, but on all known implementations this is a pointer, so void* is the correct size.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

# Software documentation for the NSURLSessionUploadTask class

## NSURLSessionUploadTask : NSURLSessionDataTask

> Declared in:
>   Foundation/NSURLSession.h

Availability: MacOS-X 10.9.0
Description forthcoming.

# Software documentation for the NSURLSession(NSURLSessionAsynchronousConvenience) category

## NSURLSession(NSURLSessionAsynchronousConvenience)

> Declared in:
>   Foundation/NSURLSession.h

Availability: MacOS-X 10.9.0
Description forthcoming.
Method summary

- -dataTaskWithRequest:completionHandler:
- -dataTaskWithURL:completionHandler:
- -downloadTaskWithRequest:completionHandler:
- -downloadTaskWithResumeData:completionHandler:
- -downloadTaskWithURL:completionHandler:
- -uploadTaskWithRequest:fromData:completionHandler:
- -uploadTaskWithRequest:fromFile:completionHandler:

### dataTaskWithRequest: completionHandler:

- (NSURLSessionDataTask*) dataTaskWithRequest: (NSURLRequest*)request completionHandler: (void(^)(NSData*data,NSURLResponse*response,NSError*error))completionHandler;
Availability: MacOS-X 10.9.0
Description forthcoming.

### dataTaskWithURL: completionHandler:

- (NSURLSessionDataTask*) dataTaskWithURL: (NSURL*)url completionHandler: (void(^)(NSData*data,NSURLResponse*response,NSError*error))completionHandler;
Availability: MacOS-X 10.9.0
Description forthcoming.

### downloadTaskWithRequest: completionHandler:

- (NSURLSessionDownloadTask*) downloadTaskWithRequest: (NSURLRequest*)request completionHandler: (void(^)(NSURL*location,NSURLResponse*response,NSError*error))completionHandler;
Availability: MacOS-X 10.9.0
Description forthcoming.

### downloadTaskWithResumeData: completionHandler:

- (NSURLSessionDownloadTask*) downloadTaskWithResumeData: (NSData*)resumeData completionHandler: (void(^)(NSURL*location,NSURLResponse*response,NSError*error))completionHandler;
Availability: MacOS-X 10.9.0
Description forthcoming.

### downloadTaskWithURL: completionHandler:

- (NSURLSessionDownloadTask*) downloadTaskWithURL: (NSURL*)url completionHandler: (void(^)(NSURL*location,NSURLResponse*response,NSError*error))completionHandler;
Availability: MacOS-X 10.9.0
Description forthcoming.

### uploadTaskWithRequest: fromData: completionHandler:

- (NSURLSessionUploadTask*) uploadTaskWithRequest: (NSURLRequest*)request fromData: (NSData*)bodyData completionHandler: (void(^)(NSData*data,NSURLResponse*response,NSError*error))completionHandler;
Availability: MacOS-X 10.9.0
Description forthcoming.

### uploadTaskWithRequest: fromFile: completionHandler:

- (NSURLSessionUploadTask*) uploadTaskWithRequest: (NSURLRequest*)request fromFile: (NSURL*)fileURL completionHandler: (void(^)(NSData*data,NSURLResponse*response,NSError*error))completionHandler;
Availability: MacOS-X 10.9.0
Description forthcoming.

# Software documentation for the NSURLSessionDataDelegate protocol

## NSURLSessionDataDelegate

> Declared in:
>   Foundation/NSURLSession.h

> Conforms to:
>   NSURLSessionTaskDelegate

Availability: MacOS-X 10.9.0
Description forthcoming.
Method summary

- -URLSession:dataTask:didReceiveData:
- -URLSession:dataTask:didReceiveResponse:completionHandler:

### URLSession: dataTask: didReceiveData:

- (void) URLSession: (NSURLSession*)session dataTask: (NSURLSessionDataTask*)dataTask didReceiveData: (NSData*)data;
Availability: MacOS-X 10.9.0
Description forthcoming.

### URLSession: dataTask: didReceiveResponse: completionHandler:

- (void) URLSession: (NSURLSession*)session dataTask: (NSURLSessionDataTask*)dataTask didReceiveResponse: (NSURLResponse*)response completionHandler: (void(^)(NSURLSessionResponseDisposition disposition))completionHandler;
Availability: MacOS-X 10.9.0
Informs the delegate of a response. This message is sent when all the response headers have arrived, before the body of the response arrives.

# Software documentation for the NSURLSessionDelegate protocol

## NSURLSessionDelegate

> Declared in:
>   Foundation/NSURLSession.h

> Conforms to:
>   NSObject

Availability: MacOS-X 10.9.0
Description forthcoming.
Method summary

- -URLSession:didBecomeInvalidWithError:
- -URLSession:didReceiveChallenge:completionHandler:

### URLSession: didBecomeInvalidWithError:

- (void) URLSession: (NSURLSession*)session didBecomeInvalidWithError: (NSError*)error;
Availability: MacOS-X 10.9.0
Description forthcoming.

### URLSession: didReceiveChallenge: completionHandler:

- (void) URLSession: (NSURLSession*)session didReceiveChallenge: (NSURLAuthenticationChallenge*)challenge completionHandler: (void(^)(NSURLSessionAuthChallengeDisposition disposition,NSURLCredential*credential))handler;
Availability: MacOS-X 10.9.0
Description forthcoming.

# Software documentation for the NSURLSessionDownloadDelegate protocol

## NSURLSessionDownloadDelegate

> Declared in:
>   Foundation/NSURLSession.h

> Conforms to:
>   NSURLSessionTaskDelegate

Availability: MacOS-X 10.9.0
Description forthcoming.
Method summary

- -URLSession:downloadTask:didFinishDownloadingToURL:
- -URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:
- -URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:

### URLSession: downloadTask: didFinishDownloadingToURL:

- (void) URLSession: (NSURLSession*)session downloadTask: (NSURLSessionDownloadTask*)downloadTask didFinishDownloadingToURL: (NSURL*)location;
Availability: MacOS-X 10.9.0
Description forthcoming.

### URLSession: downloadTask: didResumeAtOffset: expectedTotalBytes:

- (void) URLSession: (NSURLSession*)session downloadTask: (NSURLSessionDownloadTask*)downloadTask didResumeAtOffset: (int64_t)fileOffset expectedTotalBytes: (int64_t)expectedTotalBytes;
Availability: MacOS-X 10.9.0
Description forthcoming.

### URLSession: downloadTask: didWriteData: totalBytesWritten: totalBytesExpectedToWrite:

- (void) URLSession: (NSURLSession*)session downloadTask: (NSURLSessionDownloadTask*)downloadTask didWriteData: (int64_t)bytesWritten totalBytesWritten: (int64_t)totalBytesWritten totalBytesExpectedToWrite: (int64_t)totalBytesExpectedToWrite;
Availability: MacOS-X 10.9.0
Description forthcoming.

# Software documentation for the NSURLSessionTaskDelegate protocol

## NSURLSessionTaskDelegate

> Declared in:
>   Foundation/NSURLSession.h

> Conforms to:
>   NSURLSessionDelegate

Availability: MacOS-X 10.9.0
Description forthcoming.
Method summary

- -URLSession:task:didCompleteWithError:
- -URLSession:task:didReceiveChallenge:completionHandler:
- -URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:
- -URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:

### URLSession: task: didCompleteWithError:

- (void) URLSession: (NSURLSession*)session task: (NSURLSessionTask*)task didCompleteWithError: (NSError*)error;
Availability: MacOS-X 10.9.0
Description forthcoming.

### URLSession: task: didReceiveChallenge: completionHandler:

- (void) URLSession: (NSURLSession*)session task: (NSURLSessionTask*)task didReceiveChallenge: (NSURLAuthenticationChallenge*)challenge completionHandler: (void(^)(NSURLSessionAuthChallengeDisposition disposition,NSURLCredential*credential))handler;
Availability: MacOS-X 10.9.0
Description forthcoming.

### URLSession: task: didSendBodyData: totalBytesSent: totalBytesExpectedToSend:

- (void) URLSession: (NSURLSession*)session task: (NSURLSessionTask*)task didSendBodyData: (int64_t)bytesSent totalBytesSent: (int64_t)totalBytesSent totalBytesExpectedToSend: (int64_t)totalBytesExpectedToSend;
Availability: MacOS-X 10.9.0
Description forthcoming.

### URLSession: task: willPerformHTTPRedirection: newRequest: completionHandler:

- (void) URLSession: (NSURLSession*)session task: (NSURLSessionTask*)task willPerformHTTPRedirection: (NSHTTPURLResponse*)response newRequest: (NSURLRequest*)request completionHandler: (void(^)(NSURLRequest*))completionHandler;
Availability: MacOS-X 10.9.0
Description forthcoming.

Up