-
Notifications
You must be signed in to change notification settings - Fork 30.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: improve http.setHeader and getHeader typeinfo #19902
Changes from 1 commit
3699198
32685cf
1d5c3e2
5dc2a5d
3ab5dc7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -587,9 +587,11 @@ added: v1.6.0 | |
--> | ||
|
||
* `name` {string} | ||
* Returns: {string} | ||
* Returns: {string, string[]} - type as set via `setHeader()` | ||
|
||
Reads out a header on the request. Note that the name is case insensitive. | ||
The return value is that one set via `setHeader()` as coercing to string | ||
happens during transmission. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This sentence is a bit difficult to understand. How about this instead: The type of the return value depends on the arguments provided to `setHeader()`. Also, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vsemozhetbyt Whoops, yes, thanks for the correction! |
||
|
||
Example: | ||
```js | ||
|
@@ -1210,7 +1212,8 @@ added: v0.4.0 | |
|
||
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 to send multiple headers with the same name. | ||
here to send multiple headers with the same name. Values are coerced to | ||
strings if needed during transmission. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps just this for the last sentence? |
||
|
||
Example: | ||
|
||
|
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
type as set via
part seems out of place. If the information is critical, it can be included in the text below.Use a
|
to separate the two possible return types, not a comma. (This is to be consistent with our documentation elsewhere.)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.
@vsemozhetbyt Yes, thanks, updated!