Last active
August 29, 2015 14:16
-
-
Save viezel/b3ad66b0fef002e9d22b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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