{"action":"created","issue":{"url":"https://api.github.com/repos/naugtur/xhr/issues/141","repository_url":"https://api.github.com/repos/naugtur/xhr","labels_url":"https://api.github.com/repos/naugtur/xhr/issues/141/labels{/name}","comments_url":"https://api.github.com/repos/naugtur/xhr/issues/141/comments","events_url":"https://api.github.com/repos/naugtur/xhr/issues/141/events","html_url":"https://github.com/naugtur/xhr/issues/141","id":191153319,"number":141,"title":"options.json === false","user":{"login":"dhritzkiv","id":1349865,"avatar_url":"https://avatars.githubusercontent.com/u/1349865?v=3","gravatar_id":"","url":"https://api.github.com/users/dhritzkiv","html_url":"https://github.com/dhritzkiv","followers_url":"https://api.github.com/users/dhritzkiv/followers","following_url":"https://api.github.com/users/dhritzkiv/following{/other_user}","gists_url":"https://api.github.com/users/dhritzkiv/gists{/gist_id}","starred_url":"https://api.github.com/users/dhritzkiv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhritzkiv/subscriptions","organizations_url":"https://api.github.com/users/dhritzkiv/orgs","repos_url":"https://api.github.com/users/dhritzkiv/repos","events_url":"https://api.github.com/users/dhritzkiv/events{/privacy}","received_events_url":"https://api.github.com/users/dhritzkiv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-22T23:29:06Z","updated_at":"2016-11-23T18:21:42Z","closed_at":null,"body":"Per the recent `json` option behaviour changes, where:\r\n\r\n- `json: true` causes `body` to be serialized with `JSON.stringify`; and by extension,\r\n- `true` is not a valid json value (anymore)\r\n\r\nWhat should the behaviour for `json: false` be? By the logic of the second point (which I agree with), `false` should also not be a valid value.\r\n\r\nHowever, passing `json: false`<sup>*</sup> currently results in \"false\" being sent, instead of disabling json behaviour.\r\n\r\n###### <sup>*</sup> Passing `false` may be a desired thing to do if `json: true` is default behaviour for 99% of requests (for example, by using `ajaxConfig` in ampersand-sync), but you want to disable json behaviour for one request.\r\n\r\n-----\r\n\r\nI propose that L161 is changed from:\r\n\r\n```js\r\nif (\"json\" in options) {\r\n```\r\n\r\nto\r\n\r\n```js\r\nif (\"json\" in options && options.json !== false) {\r\n```\r\n\r\nTo disable json behaviour when `json: false` is passed into the options.\r\n\r\nThis raises questions of what to do about `null` and `undefined`, but I think this is a good starting point, as `false` is very explicit and unambiguous.\r\n\r\nLet me know your thoughts, and I can submit a PR!"},"comment":{"url":"https://api.github.com/repos/naugtur/xhr/issues/comments/262593399","html_url":"https://github.com/naugtur/xhr/issues/141#issuecomment-262593399","issue_url":"https://api.github.com/repos/naugtur/xhr/issues/141","id":262593399,"user":{"login":"naugtur","id":509375,"avatar_url":"https://avatars.githubusercontent.com/u/509375?v=3","gravatar_id":"","url":"https://api.github.com/users/naugtur","html_url":"https://github.com/naugtur","followers_url":"https://api.github.com/users/naugtur/followers","following_url":"https://api.github.com/users/naugtur/following{/other_user}","gists_url":"https://api.github.com/users/naugtur/gists{/gist_id}","starred_url":"https://api.github.com/users/naugtur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naugtur/subscriptions","organizations_url":"https://api.github.com/users/naugtur/orgs","repos_url":"https://api.github.com/users/naugtur/repos","events_url":"https://api.github.com/users/naugtur/events{/privacy}","received_events_url":"https://api.github.com/users/naugtur/received_events","type":"User","site_admin":false},"created_at":"2016-11-23T18:21:42Z","updated_at":"2016-11-23T18:21:42Z","body":"oops. \r\nI don't know how I overlooked that.\r\n\r\n\r\n"}}
{"actor":{"display_login":"naugtur"}}