What is the difference between these 2. I am able to get the data from the server using both.
Asked
Active
Viewed 415 times
0
-
Possible duplicate of [What is difference between NSURLSessionDataTask vs NSURLSessionDownloadTask](http://stackoverflow.com/questions/20604910/what-is-difference-between-nsurlsessiondatatask-vs-nsurlsessiondownloadtask) – mfaani Dec 24 '16 at 03:49
1 Answers
2
There are three types of concrete session tasks in this context:
NSURLSessionDataTask: Use this task for HTTP GET requests to retrieve data from servers to memory.
NSURLSessionUploadTask: Use this task to upload a file from disk to a web service, typically via a HTTP POST or PUT method.
NSURLSessionDownloadTask: Use this task to download a file from a remote service to a temporary file location.
You can also suspend, resume and cancel tasks. NSURLSessionDownloadTask has the additional ability to pause for future resumption.

balkaran singh
- 2,754
- 1
- 17
- 32