Skip to content

Commit 9320000

Browse files
Ayase-252targos
authored andcommitted
doc: fix grammar errors in http document
PR-URL: #37265 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
1 parent 19e8ae4 commit 9320000

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

doc/api/http.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -2213,7 +2213,7 @@ Emitted when the buffer of the message is free again.
22132213
added: v0.1.17
22142214
-->
22152215

2216-
Emitted when transmission is finished successfully.
2216+
Emitted when the transmission is finished successfully.
22172217

22182218
### Event: `prefinish`
22192219
<!-- YAML
@@ -2234,9 +2234,9 @@ added: v0.3.0
22342234
Adds HTTP trailers (headers but at the end of the message) to the message.
22352235

22362236
Trailers are **only** be emitted if the message is chunked encoded. If not,
2237-
trailer will be silently discarded.
2237+
the trailer will be silently discarded.
22382238

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

22422242
```js
@@ -2325,8 +2325,8 @@ added: v0.4.0
23252325
* `name` {string} Name of header
23262326
* Returns {string | undefined}
23272327

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

23312331
### `outgoingMessage.getHeaderNames()`
23322332
<!-- YAML
@@ -2347,7 +2347,7 @@ added: v8.0.0
23472347

23482348
Returns a shallow copy of the current outgoing headers. Since a shallow
23492349
copy is used, array values may be mutated without additional calls to
2350-
various header-related http module methods. The keys of the returned
2350+
various header-related HTTP module methods. The keys of the returned
23512351
object are the header names and the values are the respective header
23522352
values. All header names are lowercase.
23532353

@@ -2400,7 +2400,7 @@ Since `OutgoingMessage` should be a write-only stream,
24002400
call this function will throw an `Error`. Thus, it disabled the pipe method
24012401
it inherits from `Stream`.
24022402

2403-
User should not call this function directly.
2403+
The User should not call this function directly.
24042404

24052405
### `outgoingMessage.removeHeader()`
24062406
<!-- YAML
@@ -2422,7 +2422,7 @@ added: v0.4.0
24222422
* `value` {string} Header value
24232423
* Returns: {this}
24242424

2425-
Sets a single header value for header object.
2425+
Sets a single header value for the header object.
24262426

24272427
### `outgoingMessage.setTimeout(msesc[, callback])`
24282428
<!-- YAML
@@ -2444,7 +2444,7 @@ added: v0.3.0
24442444

24452445
* {stream.Duplex}
24462446

2447-
Reference to the underlying socket. Usually users will not want to access
2447+
Reference to the underlying socket. Usually, users will not want to access
24482448
this property.
24492449

24502450
After calling `outgoingMessage.end()`, this property will be nulled.
@@ -2497,8 +2497,8 @@ This `outgoingMessage.writableHighWaterMark` will be the `highWaterMark` of
24972497
underlying socket if socket exists. Else, it would be the default
24982498
`highWaterMark`.
24992499

2500-
`highWaterMark` is the maximum amount of data which can be potentially
2501-
buffered by socket.
2500+
`highWaterMark` is the maximum amount of data that can be potentially
2501+
buffered by the socket.
25022502

25032503
### `outgoingMessage.writableLength`
25042504
<!-- YAML
@@ -2532,11 +2532,11 @@ changes:
25322532
* `callback` {Function}
25332533
* Returns {boolean}
25342534

2535-
If this method is called and header is not sent, it will call
2535+
If this method is called and the header is not sent, it will call
25362536
`this._implicitHeader` to flush implicit header.
25372537
If the message should not have a body (indicated by `this._hasBody`),
25382538
the call is ignored and `chunk` will not be sent. It could be useful
2539-
when handling particular message which must not include a body.
2539+
when handling a particular message which must not include a body.
25402540
e.g. response to `HEAD` request, `204` and `304` response.
25412541

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

25462546
If the message is transferred in chucked encoding
25472547
(indicated by `this.chunkedEncoding`), `chunk` will be flushed as
2548-
one chunk among a stream of chunks. Otherwise, it will be flushed as body
2549-
of message.
2548+
one chunk among a stream of chunks. Otherwise, it will be flushed as the
2549+
body of message.
25502550

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

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

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

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

25652565
## `http.METHODS`

0 commit comments

Comments
 (0)