Skip to content

Commit 705bdfb

Browse files
Ayase-252danielleadams
authored andcommitted
doc: fix grammar errors in http document
PR-URL: #37265 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
1 parent e5f7179 commit 705bdfb

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

doc/api/http.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2232,7 +2232,7 @@ Emitted when the buffer of the message is free again.
22322232
added: v0.1.17
22332233
-->
22342234

2235-
Emitted when transmission is finished successfully.
2235+
Emitted when the transmission is finished successfully.
22362236

22372237
### Event: `prefinish`
22382238
<!-- YAML
@@ -2253,9 +2253,9 @@ added: v0.3.0
22532253
Adds HTTP trailers (headers but at the end of the message) to the message.
22542254

22552255
Trailers are **only** be emitted if the message is chunked encoded. If not,
2256-
trailer will be silently discarded.
2256+
the trailer will be silently discarded.
22572257

2258-
HTTP requires the `Trailer` header to be sent in order to emit trailers,
2258+
HTTP requires the `Trailer` header to be sent to emit trailers,
22592259
with a list of header fields in its value, e.g.
22602260

22612261
```js
@@ -2344,8 +2344,8 @@ added: v0.4.0
23442344
* `name` {string} Name of header
23452345
* Returns {string | undefined}
23462346

2347-
Gets value of HTTP header with given name. If such name doesn't exist in
2348-
message, it will be `undefined`.
2347+
Gets the value of HTTP header with the given name. If such a name doesn't
2348+
exist in message, it will be `undefined`.
23492349

23502350
### `outgoingMessage.getHeaderNames()`
23512351
<!-- YAML
@@ -2366,7 +2366,7 @@ added: v8.0.0
23662366

23672367
Returns a shallow copy of the current outgoing headers. Since a shallow
23682368
copy is used, array values may be mutated without additional calls to
2369-
various header-related http module methods. The keys of the returned
2369+
various header-related HTTP module methods. The keys of the returned
23702370
object are the header names and the values are the respective header
23712371
values. All header names are lowercase.
23722372

@@ -2419,7 +2419,7 @@ Since `OutgoingMessage` should be a write-only stream,
24192419
call this function will throw an `Error`. Thus, it disabled the pipe method
24202420
it inherits from `Stream`.
24212421

2422-
User should not call this function directly.
2422+
The User should not call this function directly.
24232423

24242424
### `outgoingMessage.removeHeader()`
24252425
<!-- YAML
@@ -2441,7 +2441,7 @@ added: v0.4.0
24412441
* `value` {string} Header value
24422442
* Returns: {this}
24432443

2444-
Sets a single header value for header object.
2444+
Sets a single header value for the header object.
24452445

24462446
### `outgoingMessage.setTimeout(msesc[, callback])`
24472447
<!-- YAML
@@ -2463,7 +2463,7 @@ added: v0.3.0
24632463

24642464
* {stream.Duplex}
24652465

2466-
Reference to the underlying socket. Usually users will not want to access
2466+
Reference to the underlying socket. Usually, users will not want to access
24672467
this property.
24682468

24692469
After calling `outgoingMessage.end()`, this property will be nulled.
@@ -2516,8 +2516,8 @@ This `outgoingMessage.writableHighWaterMark` will be the `highWaterMark` of
25162516
underlying socket if socket exists. Else, it would be the default
25172517
`highWaterMark`.
25182518

2519-
`highWaterMark` is the maximum amount of data which can be potentially
2520-
buffered by socket.
2519+
`highWaterMark` is the maximum amount of data that can be potentially
2520+
buffered by the socket.
25212521

25222522
### `outgoingMessage.writableLength`
25232523
<!-- YAML
@@ -2551,11 +2551,11 @@ changes:
25512551
* `callback` {Function}
25522552
* Returns {boolean}
25532553

2554-
If this method is called and header is not sent, it will call
2554+
If this method is called and the header is not sent, it will call
25552555
`this._implicitHeader` to flush implicit header.
25562556
If the message should not have a body (indicated by `this._hasBody`),
25572557
the call is ignored and `chunk` will not be sent. It could be useful
2558-
when handling particular message which must not include a body.
2558+
when handling a particular message which must not include a body.
25592559
e.g. response to `HEAD` request, `204` and `304` response.
25602560

25612561
`chunk` can be a string or a buffer. When `chunk` is a string, the
@@ -2564,21 +2564,21 @@ e.g. response to `HEAD` request, `204` and `304` response.
25642564

25652565
If the message is transferred in chucked encoding
25662566
(indicated by `this.chunkedEncoding`), `chunk` will be flushed as
2567-
one chunk among a stream of chunks. Otherwise, it will be flushed as body
2568-
of message.
2567+
one chunk among a stream of chunks. Otherwise, it will be flushed as the
2568+
body of message.
25692569

2570-
This method handles the raw body of HTTP message and has nothing to do with
2571-
higher-level multi-part body encodings that may be used.
2570+
This method handles the raw body of the HTTP message and has nothing to do
2571+
with higher-level multi-part body encodings that may be used.
25722572

25732573
If it is the first call to this method of a message, it will send the
25742574
buffered header first, then flush the the `chunk` as described above.
25752575

2576-
The second and successive calls to this method, it will assume the data
2577-
will streamed and send the new data separately. It means that the response
2576+
The second and successive calls to this method will assume the data
2577+
will be streamed and send the new data separately. It means that the response
25782578
is buffered up to the first chunk of the body.
25792579

25802580
Returns `true` if the entire data was flushed successfully to the kernel
2581-
buffer. Returns `false` if all or part of the data was queued in user
2581+
buffer. Returns `false` if all or part of the data was queued in the user
25822582
memory. Event `drain` will be emitted when the buffer is free again.
25832583

25842584
## `http.METHODS`

0 commit comments

Comments
 (0)