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: fix http.ClientRequest method descriptions #15163

Conversation

antoine-amara
Copy link
Contributor

@antoine-amara antoine-amara commented Sep 3, 2017

fix documentation for methods getHeader, setHeader and removeHeader
for http.ClientRequest class. The documentation said these functions
can be called but they're wasn't describe into the API description yet.

add parameters and general description for each methods.

Fixes: #15048

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

@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 Sep 3, 2017
Copy link
Member

@benjamingr benjamingr left a comment

Choose a reason for hiding this comment

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

I'm not sure the terminology of looking at request headers as "technically queued" is useful when explaining the concept.

That said, it's what we're currently doing in HTTP1 responses so I'm not going to block on it.

Could you please change the text in:

The header is still mutable using the setHeader(name, value), getHeader(name), removeHeader(name) API. The actual header will be sent along with the first data chunk or when closing the connection.

to links to the new method?

doc/api/http.md Outdated
* `name` {string}
* `value` {string}

Sets a single header value for implicit headers. If this header already exists in the to-be-sent headers, its value will be replaced. Use an array of strings here if you need to send multiple headers with the same name.
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure the meaning of 'for implicit headers' is clear enough.

doc/api/http.md Outdated

* `name` {string}

Removes a header that's queued for implicit sending.
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 think 'queued for implicit sending' is terminology I want to expose our users to.

doc/api/http.md Outdated
* `name` {string}
* Returns: {string}

Reads out a header that's already been queued. Note that the name is case insensitive.
Copy link
Member

Choose a reason for hiding this comment

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

'Reads out a header on the request' maybe?

@antoine-amara antoine-amara force-pushed the doc-#15048-clientrequest-documentation-inconsistencies branch from cbbd33e to 6670c2b Compare September 4, 2017 20:55
@antoine-amara
Copy link
Contributor Author

@benjamingr, I commit new changes, thanks for your first review.

doc/api/http.md Outdated
* `name` {string}
* `value` {string}

Sets a single header value for headers object. If this header already exists in the to-be-sent headers, its value will be replaced. Use an array of strings here if you need to send multiple headers with the same name.
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 things here:

  1. This is a long line. Please line wrap at <= 80 chars
  2. Please avoid the use of you in the docs.

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.

thank you for this! have a couple of things that need fixing!

@antoine-amara antoine-amara force-pushed the doc-#15048-clientrequest-documentation-inconsistencies branch 2 times, most recently from 6670c2b to 44c0877 Compare September 7, 2017 12:55
@BridgeAR
Copy link
Member

BridgeAR commented Sep 9, 2017

I think everything got addressed

@antoine-amara
Copy link
Contributor Author

@BridgeAR, @jasnell, @benjamingr , should I rebase master and push the new commits into this branch before the next review ?

@jasnell
Copy link
Member

jasnell commented Sep 13, 2017

rebasing is always a good idea! :-)

@antoine-amara
Copy link
Contributor Author

ok so I rebase before the merge, I leave a comment after I push

@antoine-amara antoine-amara force-pushed the doc-#15048-clientrequest-documentation-inconsistencies branch from 44c0877 to bcdc178 Compare September 13, 2017 16:24
@antoine-amara
Copy link
Contributor Author

Ok, @BridgeAR, @jasnell, @benjamingr, the branch is up to date :) thanks for your reviews.

fix documentation for methods getHeader, setHeader and removeHeader
for http.ClientRequest class. The documentation said these functions
can be called but they're wasn't describe into the API description yet.

add parameters and general description for each methods.

Fixes: nodejs#15048
@antoine-amara antoine-amara force-pushed the doc-#15048-clientrequest-documentation-inconsistencies branch from bcdc178 to adc1d28 Compare September 14, 2017 18:18
jasnell pushed a commit that referenced this pull request Sep 15, 2017
fix documentation for methods getHeader, setHeader and removeHeader
for http.ClientRequest class. The documentation said these functions
can be called but they're wasn't describe into the API description yet.

add parameters and general description for each methods.

PR-URL: #15163
Fixes: #15048
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
@jasnell
Copy link
Member

jasnell commented Sep 15, 2017

Landed in ca2c73c

@jasnell jasnell closed this Sep 15, 2017
addaleax pushed a commit to addaleax/ayo that referenced this pull request Sep 17, 2017
fix documentation for methods getHeader, setHeader and removeHeader
for http.ClientRequest class. The documentation said these functions
can be called but they're wasn't describe into the API description yet.

add parameters and general description for each methods.

PR-URL: nodejs/node#15163
Fixes: nodejs/node#15048
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
jasnell pushed a commit that referenced this pull request Sep 20, 2017
fix documentation for methods getHeader, setHeader and removeHeader
for http.ClientRequest class. The documentation said these functions
can be called but they're wasn't describe into the API description yet.

add parameters and general description for each methods.

PR-URL: #15163
Fixes: #15048
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Qard pushed a commit to Qard/ayo that referenced this pull request Sep 21, 2017
fix documentation for methods getHeader, setHeader and removeHeader
for http.ClientRequest class. The documentation said these functions
can be called but they're wasn't describe into the API description yet.

add parameters and general description for each methods.

PR-URL: nodejs/node#15163
Fixes: nodejs/node#15048
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
decareano added a commit to decareano/node that referenced this pull request Sep 22, 2017
doc: fix http.ClientRequest method descriptions

fix documentation for methods getHeader, setHeader and removeHeader
for http.ClientRequest class. The documentation said these functions
can be called but they're wasn't describe into the API description yet.

add parameters and general description for each methods.

PR-URL: nodejs#15163
Fixes: nodejs#15048
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>

assert: use Same-value equality in deepStrictEqual

PR-URL: nodejs#15398
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>

formatting fix and scar deleted
@antoine-amara antoine-amara deleted the doc-#15048-clientrequest-documentation-inconsistencies branch September 28, 2017 08:08
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.

http.ClientRequest documentation inconsistencies (again)
6 participants