Reputation: 149
In NSURLSession, we can use POST method to send data to server using NSURLSessionDataTask and NSURLSessionUploadTask. What is the difference between the two?
Upvotes: 4
Views: 1467
Reputation: 121
Big difference is that you can't use NSURLSessionDataTask to upload in the background. You need to use NSURLSessionUploadTask for that.
Unlike data tasks, you can use upload tasks to upload content in the background. (For details, see URL Session Programming Guide.)
Upvotes: 3