Skip to content

Commit 598aa29

Browse files
inoway46aduh95
authored andcommitted
doc: fix http response.writeProcessing() description
The description of response.writeProcessing() was copied from response.writeContinue() and said that the request body should be sent, which is what 100 Continue means, not 102 Processing. Describe what 102 means, document the callback that both methods have always accepted, and point to the equivalent response.writeInformation() call. Signed-off-by: inoway46 <inoueyuya416@gmail.com> Assisted-by: Claude Code PR-URL: #67705 Reviewed-By: Ethan Arrowood <ethan@arrowood.dev> Reviewed-By: Tim Perry <pimterry@gmail.com>
1 parent dabbbee commit 598aa29

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

‎doc/api/http.md‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2577,12 +2577,15 @@ Returns `true` if the entire data was flushed successfully to the kernel
25772577
buffer. Returns `false` if all or part of the data was queued in user memory.
25782578
`'drain'` will be emitted when the buffer is free again.
25792579

2580-
### `response.writeContinue()`
2580+
### `response.writeContinue([callback])`
25812581

25822582
<!-- YAML
25832583
added: v0.3.0
25842584
-->
25852585

2586+
* `callback` {Function} Optional, called once the message has been written
2587+
to the socket.
2588+
25862589
Sends an HTTP/1.1 100 Continue message to the client, indicating that
25872590
the request body should be sent. See the [`'checkContinue'`][] event on
25882591
`Server`.
@@ -2744,14 +2747,18 @@ event on `http.ClientRequest`.
27442747
response.writeInformation(110, { 'X-Progress': '50%' });
27452748
```
27462749

2747-
### `response.writeProcessing()`
2750+
### `response.writeProcessing([callback])`
27482751

27492752
<!-- YAML
27502753
added: v10.0.0
27512754
-->
27522755

2756+
* `callback` {Function} Optional, called once the message has been written
2757+
to the socket.
2758+
27532759
Sends an HTTP/1.1 102 Processing message to the client, indicating that
2754-
the request body should be sent.
2760+
the request has been received and is still being processed. This is
2761+
equivalent to `response.writeInformation(102, null, callback)`.
27552762

27562763
## Class: `http.IncomingMessage`
27572764

@@ -5018,10 +5025,10 @@ const agent2 = new http.Agent({ proxyEnv: process.env });
50185025
[`response.writableFinished`]: #responsewritablefinished
50195026
[`response.write()`]: #responsewritechunk-encoding-callback
50205027
[`response.write(data, encoding)`]: #responsewritechunk-encoding-callback
5021-
[`response.writeContinue()`]: #responsewritecontinue
5028+
[`response.writeContinue()`]: #responsewritecontinuecallback
50225029
[`response.writeEarlyHints()`]: #responsewriteearlyhintshints-callback
50235030
[`response.writeHead()`]: #responsewriteheadstatuscode-statusmessage-headers
5024-
[`response.writeProcessing()`]: #responsewriteprocessing
5031+
[`response.writeProcessing()`]: #responsewriteprocessingcallback
50255032
[`server.close()`]: #serverclosecallback
50265033
[`server.headersTimeout`]: #serverheaderstimeout
50275034
[`server.keepAliveTimeoutBuffer`]: #serverkeepalivetimeoutbuffer

0 commit comments

Comments
 (0)