You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var res = yield request
.get('http://local')
.auth('tobi', 'learnboost')
However, console.log(res) shows that it is a Request object, not a Response object. So without stuffing callbacks and wrapping in promises, what's the right way to get the response data out?
Is this a bug? Perhaps it is a partial code example and some other code is required?
The text was updated successfully, but these errors were encountered:
In the current version .then is a bit of a hack #722, and depends on the generator being used by a Promise-wrapping library that will call .then() on it exactly only once. We're planning to fix it #925.
Yeah, for my application this does work. Right now I'm wrapping it as a promise, but your passing it to resolve directly is more concise ... though there is no error handling here of course. But I can work with it anyway, thanks.
Per the docs: http://visionmedia.github.io/superagent/ - at the end, there is this example under the section Generator Support:
However, console.log(res) shows that it is a Request object, not a Response object. So without stuffing callbacks and wrapping in promises, what's the right way to get the response data out?
Is this a bug? Perhaps it is a partial code example and some other code is required?
The text was updated successfully, but these errors were encountered: