{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/22162","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/22162/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/22162/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/22162/events","html_url":"https://github.com/nodejs/node/issues/22162","id":348081075,"node_id":"MDU6SXNzdWUzNDgwODEwNzU=","number":22162,"title":"http.get method() ignores query params when passing an URL as first argument","user":{"login":"gabriel-araujjo","id":3980936,"node_id":"MDQ6VXNlcjM5ODA5MzY=","avatar_url":"https://avatars1.githubusercontent.com/u/3980936?v=4","gravatar_id":"","url":"https://api.github.com/users/gabriel-araujjo","html_url":"https://github.com/gabriel-araujjo","followers_url":"https://api.github.com/users/gabriel-araujjo/followers","following_url":"https://api.github.com/users/gabriel-araujjo/following{/other_user}","gists_url":"https://api.github.com/users/gabriel-araujjo/gists{/gist_id}","starred_url":"https://api.github.com/users/gabriel-araujjo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabriel-araujjo/subscriptions","organizations_url":"https://api.github.com/users/gabriel-araujjo/orgs","repos_url":"https://api.github.com/users/gabriel-araujjo/repos","events_url":"https://api.github.com/users/gabriel-araujjo/events{/privacy}","received_events_url":"https://api.github.com/users/gabriel-araujjo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-06T21:02:44Z","updated_at":"2018-08-06T21:13:39Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nThank you for reporting an issue.\r\n\r\nThis issue tracker is for bugs and issues found within Node.js core.\r\nIf you require more general support please file an issue on our help\r\nrepo. https://github.com/nodejs/help\r\n\r\n\r\nPlease fill in as much of the template below as you're able.\r\n\r\nVersion: output of `node -v`\r\nPlatform: output of `uname -a` (UNIX), or version and 32 or 64-bit (Windows)\r\nSubsystem: if known, please specify affected core module name\r\n\r\nIf possible, please provide code that demonstrates the problem, keeping it as\r\nsimple and free of external dependencies as you are able.\r\n-->\r\n\r\n* **Version**: v8.10.0\r\n* **Platform**: Linux 4.15.0-29-generic Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux\r\n* **Subsystem**: http\r\n\r\n\r\n<!-- Enter your issue details below this comment. -->\r\n\r\nWhen passing an `URL` with query params as the first argument to `http.get()` method, the query is ignored.\r\n\r\n```js\r\nconst URL = require('url');\r\nconst http = require('http');\r\nconst assert = require('assert');\r\n\r\nfunction parseJsonResp(next) {\r\n   return function(resp) {\r\n     var raw = '';\r\n     resp.on('data', function(chunk) {\r\n       raw += chunk;\r\n     });\r\n     resp.on('end', function() {\r\n       next(null, JSON.parse(raw));\r\n     });\r\n  }\r\n};\r\n\r\nconst url = URL.parse('http://httpbin.org/get');\r\nurl.query = {foo: 'bar'}\r\n\r\nhttp.get(url, parseJsonResp(function(err, obj) {\r\n  assert(obj.args.foo === 'bar'); // It fails here\r\n}));\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/410854904","html_url":"https://github.com/nodejs/node/issues/22162#issuecomment-410854904","issue_url":"https://api.github.com/repos/nodejs/node/issues/22162","id":410854904,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMDg1NDkwNA==","user":{"login":"devsnek","id":5952481,"node_id":"MDQ6VXNlcjU5NTI0ODE=","avatar_url":"https://avatars3.githubusercontent.com/u/5952481?v=4","gravatar_id":"","url":"https://api.github.com/users/devsnek","html_url":"https://github.com/devsnek","followers_url":"https://api.github.com/users/devsnek/followers","following_url":"https://api.github.com/users/devsnek/following{/other_user}","gists_url":"https://api.github.com/users/devsnek/gists{/gist_id}","starred_url":"https://api.github.com/users/devsnek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devsnek/subscriptions","organizations_url":"https://api.github.com/users/devsnek/orgs","repos_url":"https://api.github.com/users/devsnek/repos","events_url":"https://api.github.com/users/devsnek/events{/privacy}","received_events_url":"https://api.github.com/users/devsnek/received_events","type":"User","site_admin":false},"created_at":"2018-08-06T21:13:39Z","updated_at":"2018-08-06T21:13:39Z","author_association":"MEMBER","body":"http.get doesn't expect a whatwg url object, it expects an options argument similar to the output of `url.parse()`"}}
{"actor":{"display_login":"devsnek"}}