diff options
author | Vse Mozhet Byt <vsemozhetbyt@gmail.com> | 2018-08-26 19:02:27 +0300 |
---|---|---|
committer | Vse Mozhet Byt <vsemozhetbyt@gmail.com> | 2018-08-29 16:53:03 +0300 |
commit | 1a25f9639a9668d8ea90022b0f3d3b47d29971b6 (patch) | |
tree | ceba486d64311f7d40be3ad57db6bb217f9213fa /doc/api/http2.md | |
parent | b2f0cfa6b0e139a2f990d4e1e7104abf015fe8e7 (diff) | |
download | android-node-v8-1a25f9639a9668d8ea90022b0f3d3b47d29971b6.tar.gz android-node-v8-1a25f9639a9668d8ea90022b0f3d3b47d29971b6.tar.bz2 android-node-v8-1a25f9639a9668d8ea90022b0f3d3b47d29971b6.zip |
doc: remove redundant 'Example:' and similar notes
Some nits were also fixed in passing.
PR-URL: https://github.com/nodejs/node/pull/22537
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api/http2.md')
-rw-r--r-- | doc/api/http2.md | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/doc/api/http2.md b/doc/api/http2.md index b08e3b3498..c8806cf202 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -2493,7 +2493,6 @@ added: v8.4.0 The request/response headers object. Key-value pairs of header names and values. Header names are lower-cased. -Example: ```js // Prints something like: @@ -2538,8 +2537,7 @@ added: v8.4.0 * {string} -The request method as a string. Read-only. Example: -`'GET'`, `'DELETE'`. +The request method as a string. Read-only. Examples: `'GET'`, `'DELETE'`. #### request.rawHeaders <!-- YAML @@ -2666,7 +2664,7 @@ Then `request.url` will be: ``` To parse the url into its parts `require('url').parse(request.url)` -can be used. Example: +can be used: ```txt $ node @@ -2689,7 +2687,6 @@ Url { To extract the parameters from the query string, the `require('querystring').parse` function can be used, or `true` can be passed as the second argument to `require('url').parse`. -Example: ```txt $ node @@ -2807,8 +2804,6 @@ added: v8.4.0 Reads out a header that has already been queued but not sent to the client. Note that the name is case insensitive. -Example: - ```js const contentType = response.getHeader('content-type'); ``` @@ -2823,8 +2818,6 @@ added: v8.4.0 Returns an array containing the unique names of the current outgoing headers. All header names are lowercase. -Example: - ```js response.setHeader('Foo', 'bar'); response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); @@ -2851,8 +2844,6 @@ prototypically inherit from the JavaScript `Object`. This means that typical `Object` methods such as `obj.toString()`, `obj.hasOwnProperty()`, and others are not defined and *will not work*. -Example: - ```js response.setHeader('Foo', 'bar'); response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); @@ -2872,8 +2863,6 @@ added: v8.4.0 Returns `true` if the header identified by `name` is currently set in the outgoing headers. Note that the header name matching is case-insensitive. -Example: - ```js const hasContentType = response.hasHeader('content-type'); ``` @@ -2896,8 +2885,6 @@ added: v8.4.0 Removes a header that has been queued for implicit sending. -Example: - ```js response.removeHeader('Content-Encoding'); ``` @@ -2927,8 +2914,6 @@ Sets a single header value for implicit headers. If this header already exists in the to-be-sent headers, its value will be replaced. Use an array of strings here to send multiple headers with the same name. -Example: - ```js response.setHeader('Content-Type', 'text/html'); ``` @@ -2998,8 +2983,6 @@ more information. All other interactions will be routed directly to the socket. -Example: - ```js const http2 = require('http2'); const server = http2.createServer((req, res) => { @@ -3020,8 +3003,6 @@ When using implicit headers (not calling [`response.writeHead()`][] explicitly), this property controls the status code that will be sent to the client when the headers get flushed. -Example: - ```js response.statusCode = 404; ``` @@ -3112,8 +3093,6 @@ passed as the second argument. However, because the `statusMessage` has no meaning within HTTP/2, the argument will have no effect and a process warning will be emitted. -Example: - ```js const body = 'hello world'; response.writeHead(200, { |