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 targos committed Oct 24, 2018
1 parent 086ee5e commit d808d27
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 @@ -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
Expand Down Expand Up @@ -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])
Expand Down

0 comments on commit d808d27

Please sign in to comment.