Skip to content

Commit

Permalink
doc: use Cookie in request.setHeader() examples
Browse files Browse the repository at this point in the history
`Set-Cookie` is a response header, replace it with `Cookie`.

PR-URL: #23707
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
lpinca authored and MylesBorins committed Nov 26, 2018
1 parent 60f1a5a commit 8a6086c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -599,13 +599,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
Expand Down Expand Up @@ -649,7 +649,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])
Expand Down

0 comments on commit 8a6086c

Please sign in to comment.