Search code examples
ioshttpnsurlrequest

iOS store-and-forward framework for offline HTTP POST requests


Is there a way (presumably a library?) to store HTTP POST requests when the user is offline, and then transmit the POST requests when the user is back online?

(I don't need to read the server's response, except insofar as I'll want to re-queue the requests if the POST request fails.)


Solution

  • In iOS 7, NSURLSession can do it. It can even run the request in the background when the app has stopped running.