NetworkUploadTaskOperation Class Reference
| Inherits from | NetworkDataTaskOperation : NetworkTaskOperation : NSOperation |
| Declared in | NetworkUploadTaskOperation.h NetworkUploadTaskOperation.m |
Overview
Network Upload Task Operation
This operation is instantiated by NetworkManager when performing an upload. You will not have to
interact directly with this class.
Tasks
Initialization
-
– initWithSession:request:data:Initialize upload operation
-
– initWithSession:request:fromFile:Initialize upload operation
Instance Methods
initWithSession:request:data:
Initialize upload operation
- (instancetype)initWithSession:(NSURLSession *)session request:(NSURLRequest *)request data:(NSData *)dataParameters
- session
The
NSURLSessionused for the upload task.
- request
The
NSURLRequest.
- data
The
NSDatafor the body of the request.
Discussion
Note: Do not set the body of the request in the NSMutableURLRequest object via setHTTPBody,
but rather use the data parameter of this method.
Declared In
NetworkUploadTaskOperation.hinitWithSession:request:fromFile:
Initialize upload operation
- (instancetype)initWithSession:(NSURLSession *)session request:(NSURLRequest *)request fromFile:(NSURL *)fromFileParameters
- session
The
NSURLSessionused for the upload task.
- request
The
NSURLRequest.
- fromFile
The file
NSURLfor the file containing the body of the request. This must be fully qualified URL, not a relative URL.
Discussion
Note: Do not set the body of the request in the NSMutableURLRequest object via setHTTPBody,
but rather use the data parameter of this method.
Declared In
NetworkUploadTaskOperation.h