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: adding note regarding http.get options #12124

Closed
wants to merge 1 commit into from
Closed

doc: adding note regarding http.get options #12124

wants to merge 1 commit into from

Conversation

raphaelokon
Copy link
Contributor

This addresses #12092. Adds a note to doc/api/http.md that clarifies that options
doesn't include the prototype.

Checklist
  • documentation is changed or added
  • commit message follows [commit guidelines][]
Affected core subsystem(s)

doc

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. http Issues or PRs related to the http subsystem. labels Mar 29, 2017
doc/api/http.md Outdated
@@ -1539,6 +1539,8 @@ convenience method. The only difference between this method and
automatically. Note that response data must be consumed in the callback
for reasons stated in [`http.ClientRequest`][] section.

Note: The `options` properties are copied via `util._extend()` which doesn't include the prototype.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of style nits:

  1. Please wrap at 80 chars
  2. s/Note:/*Note*:/
  3. Rewording to something like the following is likely sufficient:
*Note*: The `options` object's "own" properties are copied when passed.

The fact that it uses util._extend() is an internal implementation detail that should not be worth documenting and could change at any point in the future)

Copy link
Member

@Trott Trott Mar 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to avoid scare quotes in our docs if possible. Maybe this?:

*Note*: Properties inherited from the `options` object prototype chain are ignored.

Might it be better as part of the explanation of options and not a special note at the bottom?

  * `options` {Object | string} Accepts the same `options` as
  [`http.request()`][], with the `method` always set to `GET`.
  Properties that are inherited from the prototype are ignored.

Also: Should this note be added to all relevant functions and not just .get()?

@nodejs/documentation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aww sorry.
@jasnell You are right.

@Trott I was thinking adding it to all affected options occurrences later on.
I also like the idea to attach it directly to the explanation of options. If we can agree I will rebase and push again.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay – added the changes.

Extra notes that options doesn't include the prototype when copied #12092
@raphaelokon raphaelokon changed the title Adding note http.get options Adding note regarding http.get options Mar 30, 2017
Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@raphaelokon
Copy link
Contributor Author

@jasnell Do you still request your suggested changes? 1 & 3 should be fine now, not sure if I should add the Note bit inside the options desc.

@raphaelokon raphaelokon changed the title Adding note regarding http.get options doc: adding note regarding http.get options Mar 31, 2017
jasnell pushed a commit that referenced this pull request Apr 4, 2017
Extra notes that options doesn't include the prototype when copied

Fixes: #12092
PR-URL: #12124
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@jasnell
Copy link
Member

jasnell commented Apr 4, 2017

Landed in e1161a3

@jasnell jasnell closed this Apr 4, 2017
@jasnell jasnell mentioned this pull request Apr 4, 2017
italoacasas pushed a commit to italoacasas/node that referenced this pull request Apr 10, 2017
Extra notes that options doesn't include the prototype when copied

Fixes: nodejs#12092
PR-URL: nodejs#12124
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@italoacasas italoacasas mentioned this pull request Apr 10, 2017
2 tasks
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants