From 862b7a1c7be9322c565a40a3e18f06b0e927bda9 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Wed, 17 Oct 2018 09:40:50 +0200 Subject: [PATCH] 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 Reviewed-By: Vse Mozhet Byt Reviewed-By: James M Snell --- doc/api/http.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/api/http.md b/doc/api/http.md index d56e3b23a1611e..cf3faac293fc79 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -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])