-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: Add URL instance as options argument with http.request and https… #13405
Conversation
Nit: First line of the commit message is too long |
Thank you for the contribution! A nit: we usually wrap lines in docs at 80 characters according to the style guide. |
doc/api/http.md
Outdated
@@ -1677,8 +1685,9 @@ added: v0.3.6 | |||
Node.js maintains several connections per server to make HTTP requests. | |||
This function allows one to transparently issue requests. | |||
|
|||
`options` can be an object or a string. If `options` is a string, it is | |||
automatically parsed with [`url.parse()`][]. | |||
`options` can be an object, a string, or a [`URL`][] object. If `options` is a string, it is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I get this right, [`URL`]
should be added to the link references at the end of the file.
doc/api/http.md
Outdated
Example using options from [`URL`][]: | ||
|
||
```js | ||
const options = new URL('https://abc:xyz@example.com'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this should be http:
doc/api/http.md
Outdated
`options` can be an object or a string. If `options` is a string, it is | ||
automatically parsed with [`url.parse()`][]. | ||
`options` can be an object, a string, or a [`URL`][] object. If `options` is a string, it is | ||
automatically parsed with [`url.parse()`][]. If it's a [`URL`][] object, it will be automatically |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how consistent we are about this in the docs, but I would prefer "it is" instead of "it's".
doc/api/https.md
Outdated
`options` can be an object or a string. If `options` is a string, it is | ||
automatically parsed with [`url.parse()`][]. | ||
`options` can be an object, a string, or a [`URL`][] object. If `options` is a string, it is | ||
automatically parsed with [`url.parse()`][]. If it's a [`URL`][] object, it will be automatically |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
doc/api/https.md
Outdated
`options` can be an object or a string. If `options` is a string, it is | ||
automatically parsed with [`url.parse()`][]. | ||
`options` can be an object, a string, or a [`URL`][] object. If `options` is a string, it is | ||
automatically parsed with [`url.parse()`][]. If it's a [`URL`][] object, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
doc/api/https.md
Outdated
[`https.request()`][], with the `method` always set to `GET`. | ||
- `callback` {Function} | ||
|
||
Like [`http.get()`][] but for HTTPS. | ||
|
||
`options` can be an object or a string. If `options` is a string, it is | ||
automatically parsed with [`url.parse()`][]. | ||
`options` can be an object, a string, or a [`URL`][] object. If `options` is a string, it is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same: [`URL`]
should be added to the link references at the end of the file
Preliminary linter CI: https://ci.nodejs.org/job/node-test-linter/9557/ |
600d1b3
to
ce1e1a9
Compare
Thanks for the comments. I fixed all the requested changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with the nits already reported fixed.
@vladimir-trifonov Thank you. There are some more nits:
|
ce1e1a9
to
465261e
Compare
@vsemozhetbyt Sorry about that. You are right. I fixed them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but the code samples may want to show the necessary require()
code to get the URL
constructor.
465261e
to
b3e3ff0
Compare
Added the |
PR-URL: #13405 Fixes: #13383 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Landed in 60d14c8 with some minor wording tweaks. @vladimir-trifonov Thanks, and welcome to Node.js! |
PR-URL: #13405 Fixes: #13383 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
I don't believe this should land on v6.x Please correct me if wrong |
@MylesBorins It's for v7.5.0 if I'm not wrong. |
Correct, it should not go to 6.x |
….request
Fixes: #13383
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)