Closed twolfson closed 5 years ago
node@0.10 supports using a string as the request parameter. If it is one, it converts it into an object via url.parse.
node@0.10
url.parse
http.request.get('http://github.com/'); // equivalent to http.request.get({ hostname: 'github.com' });
https://github.com/joyent/node/blob/85e4fc4306055656f0acab0052ae6da73bfbeb1f/lib/http.js#L53-L55
I was wondering if the lack of support for this in http-browserify was intentional or not (it left me scratching my head for a bit until I saw the cause). If it was unintentional, I would be more than happy to make a PR for this.
http-browserify
+1.
Or at least a remark in the README...
This issue was fixed in #34
node@0.10
supports using a string as the request parameter. If it is one, it converts it into an object viaurl.parse
.https://github.com/joyent/node/blob/85e4fc4306055656f0acab0052ae6da73bfbeb1f/lib/http.js#L53-L55
I was wondering if the lack of support for this in
http-browserify
was intentional or not (it left me scratching my head for a bit until I saw the cause). If it was unintentional, I would be more than happy to make a PR for this.