0

What is the difference between these 2. I am able to get the data from the server using both.

Utsav Dusad
  • 1,933
  • 4
  • 24
  • 52
  • Possible duplicate of [What is difference between NSURLSessionDataTask vs NSURLSessionDownloadTask](http://stackoverflow.com/questions/20604910/what-is-difference-between-nsurlsessiondatatask-vs-nsurlsessiondownloadtask) – Honey Dec 24 '16 at 03:49

1 Answers1

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.enter image description here

balkaran singh
  • 2,628
  • 1
  • 13
  • 29