{"action":"created","issue":{"url":"https://api.github.com/repos/naugtur/xhr/issues/160","repository_url":"https://api.github.com/repos/naugtur/xhr","labels_url":"https://api.github.com/repos/naugtur/xhr/issues/160/labels{/name}","comments_url":"https://api.github.com/repos/naugtur/xhr/issues/160/comments","events_url":"https://api.github.com/repos/naugtur/xhr/issues/160/events","html_url":"https://github.com/naugtur/xhr/pull/160","id":220102840,"number":160,"title":"Add support for options.qs","user":{"login":"jmeas","id":2322305,"avatar_url":"https://avatars0.githubusercontent.com/u/2322305?v=3","gravatar_id":"","url":"https://api.github.com/users/jmeas","html_url":"https://github.com/jmeas","followers_url":"https://api.github.com/users/jmeas/followers","following_url":"https://api.github.com/users/jmeas/following{/other_user}","gists_url":"https://api.github.com/users/jmeas/gists{/gist_id}","starred_url":"https://api.github.com/users/jmeas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmeas/subscriptions","organizations_url":"https://api.github.com/users/jmeas/orgs","repos_url":"https://api.github.com/users/jmeas/repos","events_url":"https://api.github.com/users/jmeas/events{/privacy}","received_events_url":"https://api.github.com/users/jmeas/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2017-04-07T03:55:56Z","updated_at":"2017-04-08T06:40:17Z","closed_at":"2017-04-07T19:10:51Z","pull_request":{"url":"https://api.github.com/repos/naugtur/xhr/pulls/160","html_url":"https://github.com/naugtur/xhr/pull/160","diff_url":"https://github.com/naugtur/xhr/pull/160.diff","patch_url":"https://github.com/naugtur/xhr/pull/160.patch"},"body":"Just a quick proof-of-concept implementation of #159."},"comment":{"url":"https://api.github.com/repos/naugtur/xhr/issues/comments/292699118","html_url":"https://github.com/naugtur/xhr/pull/160#issuecomment-292699118","issue_url":"https://api.github.com/repos/naugtur/xhr/issues/160","id":292699118,"user":{"login":"gsf","id":151913,"avatar_url":"https://avatars1.githubusercontent.com/u/151913?v=3","gravatar_id":"","url":"https://api.github.com/users/gsf","html_url":"https://github.com/gsf","followers_url":"https://api.github.com/users/gsf/followers","following_url":"https://api.github.com/users/gsf/following{/other_user}","gists_url":"https://api.github.com/users/gsf/gists{/gist_id}","starred_url":"https://api.github.com/users/gsf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gsf/subscriptions","organizations_url":"https://api.github.com/users/gsf/orgs","repos_url":"https://api.github.com/users/gsf/repos","events_url":"https://api.github.com/users/gsf/events{/privacy}","received_events_url":"https://api.github.com/users/gsf/received_events","type":"User","site_admin":false},"created_at":"2017-04-08T06:40:17Z","updated_at":"2017-04-08T06:40:17Z","body":"Sorry I'm late to the party. To align with Node, qs, query-string, and request, the function reference should be qsStringify. That's the nomenclature. And aside from some creative edge cases, options.qs should be an Object, as it is in request.\r\n\r\nLooking at the bigger picture, do we want to keep extending the API surface on the createXhr object? That moves us further away from a guiding factor in the simplicity of request: all configuration goes in that `options` object. \r\n\r\nIn a comment on #159, @jmeas makes a point that it's \"a hard sell to use this lib for universal code, as the Node code would absolutely use the qs option.\" It's worth considering how committed we are to the \"subset of request\" goal. We could stay fully within the request API by pulling in qs as a dependency, but that obviously adds bloat that many may not need.\r\n\r\nThe qsStringify function could instead be set on `options`, similar to qsStringifyOptions in request. To avoid including it in every xhr call, we could add the rather cool request.defaults method. And if we add the undocumented `requester` argument to request.defaults, that solves the multiple signatures issue, making it just a few lines of code for anyone to add their own qs option:\r\n\r\n```js\r\nvar req = xhr.defaults(function (options, callback) {\r\n  options.uri = (options.uri || options.url) + '?' + qs.stringify(options.qs);\r\n  return xhr(options, callback);\r\n});\r\n```"}}
{"actor":{"display_login":"gsf"}}