Skip to content
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

Closed

Conversation

vladimir-trifonov
Copy link
Contributor

….request

Fixes: #13383

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to the documentations. label Jun 2, 2017
@mscdex
Copy link
Contributor

mscdex commented Jun 2, 2017

Nit: First line of the commit message is too long

@mscdex mscdex added http Issues or PRs related to the http subsystem. https Issues or PRs related to the https subsystem. labels Jun 2, 2017
@vsemozhetbyt
Copy link
Contributor

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
Copy link
Contributor

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');
Copy link
Contributor

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
Copy link
Member

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
Copy link
Member

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,
Copy link
Member

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
Copy link
Contributor

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

@vsemozhetbyt
Copy link
Contributor

Preliminary linter CI: https://ci.nodejs.org/job/node-test-linter/9557/

@vladimir-trifonov vladimir-trifonov force-pushed the issue13383 branch 3 times, most recently from 600d1b3 to ce1e1a9 Compare June 2, 2017 17:43
@vladimir-trifonov
Copy link
Contributor Author

Thanks for the comments. I fixed all the requested changes.

Copy link
Member

@jasnell jasnell left a 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.

@vsemozhetbyt
Copy link
Contributor

@vladimir-trifonov Thank you. There are some more nits:

  1. Some lines still exceed 80 characters.
  2. As you can see, link references are usually sorted alphabetically and case-sensitively.

@vladimir-trifonov
Copy link
Contributor Author

vladimir-trifonov commented Jun 2, 2017

@vsemozhetbyt Sorry about that. You are right. I fixed them.

@vsemozhetbyt
Copy link
Contributor

Copy link
Contributor

@cjihrig cjihrig left a 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.

@vladimir-trifonov
Copy link
Contributor Author

Added the require() code :)

TimothyGu pushed a commit that referenced this pull request Jun 7, 2017
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>
@TimothyGu
Copy link
Member

Landed in 60d14c8 with some minor wording tweaks. @vladimir-trifonov Thanks, and welcome to Node.js!

@TimothyGu TimothyGu closed this Jun 7, 2017
jasnell pushed a commit that referenced this pull request Jun 7, 2017
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>
@gibfahn gibfahn mentioned this pull request Jun 15, 2017
3 tasks
@MylesBorins
Copy link
Contributor

I don't believe this should land on v6.x

Please correct me if wrong

@vladimir-trifonov
Copy link
Contributor Author

@MylesBorins It's for v7.5.0 if I'm not wrong.

@jasnell
Copy link
Member

jasnell commented Jul 18, 2017

Correct, it should not go to 6.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. http Issues or PRs related to the http subsystem. https Issues or PRs related to the https subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

doc: http.request and https.request accepts WHATWG URL object as argument