Skip to content

Commit

Permalink
doc, http: add Uint8Array as allowed type
Browse files Browse the repository at this point in the history
OutgoingMessage.write()/end() and their derived classes support also
Uint8Array besides string and Buffer.

PR-URL: #45167
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
Flarna authored and danielleadams committed Jan 3, 2023
1 parent 70244d0 commit 6fb74a9
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions doc/api/http.md
Expand Up @@ -748,12 +748,15 @@ See [`writable.cork()`][].
<!-- YAML
added: v0.1.90
changes:
- version: v15.0.0
pr-url: https://github.com/nodejs/node/pull/33155
description: The `data` parameter can now be a `Uint8Array`.
- version: v10.0.0
pr-url: https://github.com/nodejs/node/pull/18780
description: This method now returns a reference to `ClientRequest`.
-->

* `data` {string|Buffer}
* `data` {string|Buffer|Uint8Array}
* `encoding` {string}
* `callback` {Function}
* Returns: {this}
Expand Down Expand Up @@ -1203,9 +1206,13 @@ before the [`'finish'`][] event is emitted.

<!-- YAML
added: v0.1.29
changes:
- version: v15.0.0
pr-url: https://github.com/nodejs/node/pull/33155
description: The `chunk` parameter can now be a `Uint8Array`.
-->

* `chunk` {string|Buffer}
* `chunk` {string|Buffer|Uint8Array}
* `encoding` {string}
* `callback` {Function}
* Returns: {boolean}
Expand Down Expand Up @@ -1727,12 +1734,15 @@ See [`writable.cork()`][].
<!-- YAML
added: v0.1.90
changes:
- version: v15.0.0
pr-url: https://github.com/nodejs/node/pull/33155
description: The `data` parameter can now be a `Uint8Array`.
- version: v10.0.0
pr-url: https://github.com/nodejs/node/pull/18780
description: This method now returns a reference to `ServerResponse`.
-->

* `data` {string|Buffer}
* `data` {string|Buffer|Uint8Array}
* `encoding` {string}
* `callback` {Function}
* Returns: {this}
Expand Down Expand Up @@ -2081,9 +2091,13 @@ before the [`'finish'`][] event is emitted.

<!-- YAML
added: v0.1.29
changes:
- version: v15.0.0
pr-url: https://github.com/nodejs/node/pull/33155
description: The `chunk` parameter can now be a `Uint8Array`.
-->

* `chunk` {string|Buffer}
* `chunk` {string|Buffer|Uint8Array}
* `encoding` {string} **Default:** `'utf8'`
* `callback` {Function}
* Returns: {boolean}
Expand Down Expand Up @@ -2765,11 +2779,14 @@ and is connected, that socket will be destroyed as well.
<!-- YAML
added: v0.1.90
changes:
- version: v15.0.0
pr-url: https://github.com/nodejs/node/pull/33155
description: The `chunk` parameter can now be a `Uint8Array`.
- version: v0.11.6
description: add `callback` argument.
-->

* `chunk` {string | Buffer}
* `chunk` {string|Buffer|Uint8Array}
* `encoding` {string} Optional, **Default**: `utf8`
* `callback` {Function} Optional
* Returns: {this}
Expand Down Expand Up @@ -3025,11 +3042,14 @@ Always `false`.
<!-- YAML
added: v0.1.29
changes:
- version: v15.0.0
pr-url: https://github.com/nodejs/node/pull/33155
description: The `chunk` parameter can now be a `Uint8Array`.
- version: v0.11.6
description: The `callback` argument was added.
-->

* `chunk` {string | Buffer}
* `chunk` {string|Buffer|Uint8Array}
* `encoding` {string} **Default**: `utf8`
* `callback` {Function}
* Returns {boolean}
Expand Down

0 comments on commit 6fb74a9

Please sign in to comment.