{"action":"created","issue":{"url":"https://api.github.com/repos/visionmedia/superagent/issues/935","repository_url":"https://api.github.com/repos/visionmedia/superagent","labels_url":"https://api.github.com/repos/visionmedia/superagent/issues/935/labels{/name}","comments_url":"https://api.github.com/repos/visionmedia/superagent/issues/935/comments","events_url":"https://api.github.com/repos/visionmedia/superagent/issues/935/events","html_url":"https://github.com/visionmedia/superagent/issues/935","id":139947501,"number":935,"title":"Yield does not return a response object","user":{"login":"tremendus","id":5451510,"avatar_url":"https://avatars.githubusercontent.com/u/5451510?v=3","gravatar_id":"","url":"https://api.github.com/users/tremendus","html_url":"https://github.com/tremendus","followers_url":"https://api.github.com/users/tremendus/followers","following_url":"https://api.github.com/users/tremendus/following{/other_user}","gists_url":"https://api.github.com/users/tremendus/gists{/gist_id}","starred_url":"https://api.github.com/users/tremendus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tremendus/subscriptions","organizations_url":"https://api.github.com/users/tremendus/orgs","repos_url":"https://api.github.com/users/tremendus/repos","events_url":"https://api.github.com/users/tremendus/events{/privacy}","received_events_url":"https://api.github.com/users/tremendus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-10T16:50:48Z","updated_at":"2016-03-11T00:25:15Z","closed_at":null,"body":"Per the docs: http://visionmedia.github.io/superagent/ - at the end, there is this example under the section **Generator Support**: \r\n\r\n```\r\nvar res = yield request\r\n  .get('http://local')\r\n  .auth('tobi', 'learnboost')\r\n```\r\n\r\nHowever, 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? \r\n\r\nIs this a bug? Perhaps it is a partial code example and some other code is required?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/visionmedia/superagent/issues/comments/195114820","html_url":"https://github.com/visionmedia/superagent/issues/935#issuecomment-195114820","issue_url":"https://api.github.com/repos/visionmedia/superagent/issues/935","id":195114820,"user":{"login":"pornel","id":72159,"avatar_url":"https://avatars.githubusercontent.com/u/72159?v=3","gravatar_id":"","url":"https://api.github.com/users/pornel","html_url":"https://github.com/pornel","followers_url":"https://api.github.com/users/pornel/followers","following_url":"https://api.github.com/users/pornel/following{/other_user}","gists_url":"https://api.github.com/users/pornel/gists{/gist_id}","starred_url":"https://api.github.com/users/pornel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pornel/subscriptions","organizations_url":"https://api.github.com/users/pornel/orgs","repos_url":"https://api.github.com/users/pornel/repos","events_url":"https://api.github.com/users/pornel/events{/privacy}","received_events_url":"https://api.github.com/users/pornel/received_events","type":"User","site_admin":false},"created_at":"2016-03-11T00:25:15Z","updated_at":"2016-03-11T00:25:15Z","body":"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.\r\n\r\nDoes the following work for you?\r\n\r\n```js\r\nvar res = yield Promise.resolve(request\r\n  .get('http://local')\r\n  .auth('tobi', 'learnboost'))\r\n```\r\n"}}