Skip to content

Commit

Permalink
doc: replace require() with reference links in http2.md
Browse files Browse the repository at this point in the history
Refs: #34929 (comment)

PR-URL: #34956
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Denys Otrishko <[email protected]>
Reviewed-By: Ricky Zhou <[email protected]>
  • Loading branch information
Trott authored and richardlau committed Sep 1, 2020
1 parent ee6a583 commit 94c6e09
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -3092,12 +3092,11 @@ Then `request.url` will be:
'/status?name=ryan'
```

To parse the url into its parts, `require('url').parse(request.url)`
can be used:
To parse the url into its parts, [`url.parse(request.url)`][`url.parse()`].

```console
$ node
> require('url').parse('/status?name=ryan')
> url.parse('/status?name=ryan')
Url {
protocol: null,
slashes: null,
Expand All @@ -3114,12 +3113,12 @@ Url {
```

To obtain the parameters from the query string, use the
`require('querystring').parse()` function or pass
`true` as the second argument to `require('url').parse()`.
[`querystring.parse()`][] function or pass
`true` as the second argument to [`url.parse()`][].

```console
$ node
> require('url').parse('/status?name=ryan', true)
> url.parse('/status?name=ryan', true)
Url {
protocol: null,
slashes: null,
Expand Down Expand Up @@ -3705,6 +3704,7 @@ following additional properties:
[`net.Socket.prototype.unref()`]: net.html#net_socket_unref
[`net.Socket`]: net.html#net_class_net_socket
[`net.connect()`]: net.html#net_net_connect
[`querystring.parse()`]: querystring.html#querystring_querystring_parse_str_sep_eq_options
[`request.socket`]: #http2_request_socket
[`request.socket.getPeerCertificate()`]: tls.html#tls_tlssocket_getpeercertificate_detailed
[`response.end()`]: #http2_response_end_data_encoding_callback
Expand All @@ -3719,5 +3719,6 @@ following additional properties:
[`tls.TLSSocket`]: tls.html#tls_class_tls_tlssocket
[`tls.connect()`]: tls.html#tls_tls_connect_options_callback
[`tls.createServer()`]: tls.html#tls_tls_createserver_options_secureconnectionlistener
[`url.parse()`]: url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost
[error code]: #error_codes
[`writable.writableFinished`]: stream.html#stream_writable_writablefinished

0 comments on commit 94c6e09

Please sign in to comment.