Skip to content

Instantly share code, notes, and snippets.

@viezel
Last active August 29, 2015 14:16
Show Gist options
  • Save viezel/b3ad66b0fef002e9d22b to your computer and use it in GitHub Desktop.
Save viezel/b3ad66b0fef002e9d22b to your computer and use it in GitHub Desktop.
//
// Start the app while being offline
// Then after these requests have been cache - go back online
//
// require this lib
var HTTPHelper = require("networkHelper");
// the http request will auto try to send queued requests when being online again
HTTPHelper.httpRequest({
url: "http://httpbin.org/post",
settings: {
timeout: 10000,
method: "POST"
},
success: function(){
Ti.API.info("SUCCESS");
},
error: function(e){
Ti.API.info(e);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment