{"action":"closed","issue":{"url":"https://api.github.com/repos/then/request/issues/7","labels_url":"https://api.github.com/repos/then/request/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/then/request/issues/7/comments","events_url":"https://api.github.com/repos/then/request/issues/7/events","html_url":"https://github.com/then/request/issues/7","id":55009201,"number":7,"title":"CORS errors resolve to statusCode: 0","user":{"login":"rstacruz","id":74385,"avatar_url":"https://avatars.githubusercontent.com/u/74385?v=3","gravatar_id":"","url":"https://api.github.com/users/rstacruz","html_url":"https://github.com/rstacruz","followers_url":"https://api.github.com/users/rstacruz/followers","following_url":"https://api.github.com/users/rstacruz/following{/other_user}","gists_url":"https://api.github.com/users/rstacruz/gists{/gist_id}","starred_url":"https://api.github.com/users/rstacruz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstacruz/subscriptions","organizations_url":"https://api.github.com/users/rstacruz/orgs","repos_url":"https://api.github.com/users/rstacruz/repos","events_url":"https://api.github.com/users/rstacruz/events{/privacy}","received_events_url":"https://api.github.com/users/rstacruz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-21T11:53:16Z","updated_at":"2015-01-26T17:42:08Z","closed_at":"2015-01-26T17:42:08Z","body":"Try this in a browser:\r\n\r\n```js\r\nrequest('GET', 'http://yahoo.com')\r\n.then(function(res) {\r\n  console.log(\"Success:\", JSON.stringify(res));\r\n})\r\n```\r\n\r\nThis will fire off a CORS handshake:\r\n\r\n```sh\r\n=> OPTIONS \"http://yahoo.com/\" \\\r\n  access-control-request-headers:\"x-requested-with\" \\\r\n  Access-Control-Request-Method:\"GET\"\r\n\r\n<= HTTP/1.1 401 Forbidden\r\n```\r\n\r\nThis gets you this result, however:\r\n\r\n```js\r\nSuccess: \"{\"statusCode\":0,\"headers\":{},\"body\":\"\"}\"\r\n```"}}