doc: use Cookie in request.setHeader() examples

`Set-Cookie` is a response header, replace it with `Cookie`.

PR-URL: https://github.com/nodejs/node/pull/23707
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Luigi Pinca authored and Michaël Zasso committed 2018-10-24 16:10:16 +02:00
1 parent 086ee5e57f
commit d808d27120
1 file changed
+4 -4
+4 -4
View File
@@ -605,13 +605,13 @@ The type of the return value depends on the arguments provided to
```js
request.setHeader('content-type', 'text/html');
request.setHeader('Content-Length', Buffer.byteLength(body));
request.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']);
request.setHeader('Cookie', ['type=ninja', 'language=javascript']);
const contentType = request.getHeader('Content-Type');
// contentType is 'text/html'
const contentLength = request.getHeader('Content-Length');
// contentLength is of type number
const setCookie = request.getHeader('set-cookie');
// setCookie is of type string[]
const cookie = request.getHeader('Cookie');
// cookie is of type string[]
```
### request.maxHeadersCount
@@ -655,7 +655,7 @@ request.setHeader('Content-Type', 'application/json');
or
```js
request.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']);
request.setHeader('Cookie', ['type=ninja', 'language=javascript']);
```
### request.setNoDelay([noDelay])