Skip to content

Instantly share code, notes, and snippets.

@kriskowal
Created September 23, 2010 03:40
Show Gist options
  • Star 26 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save kriskowal/593052 to your computer and use it in GitHub Desktop.
Save kriskowal/593052 to your computer and use it in GitHub Desktop.
var Q = require("q");
var HTTP = require("q-http");
function httpReadRetry(url, timeout, times) {
return HTTP.read(url)
.then(function (content) {
return content;
}, function (error) {
if (times == 0)
throw new Error("Can't read " + JSON.stringify(url));
return Q.delay(timeout)
.then(function () {
return httpReadRetry(url, timeout, times - 1);
});
});
}
@talk2ajay
Copy link

How do I send a JSON POST request to q-io/http.request. It is expecting array of strings a body

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment