@@ -3142,12 +3142,11 @@ Then `request.url` will be:
3142
3142
' /status?name=ryan'
3143
3143
```
3144
3144
3145
- To parse the url into its parts, ` require('url').parse(request.url) `
3146
- can be used:
3145
+ To parse the url into its parts, [ ` url.parse(request.url) ` ] [ `url.parse()` ] .
3147
3146
3148
3147
``` console
3149
3148
$ node
3150
- > require( ' url' ) .parse(' /status?name=ryan' )
3149
+ > url.parse(' /status?name=ryan' )
3151
3150
Url {
3152
3151
protocol: null,
3153
3152
slashes: null,
@@ -3164,12 +3163,12 @@ Url {
3164
3163
```
3165
3164
3166
3165
To obtain the parameters from the query string, use the
3167
- ` require(' querystring') .parse()` function or pass
3168
- ` true ` as the second argument to ` require(' url') .parse()` .
3166
+ [ ` querystring.parse() ` ] [ ] function or pass
3167
+ ` true ` as the second argument to [ ` url.parse() ` ] [ ] .
3169
3168
3170
3169
``` console
3171
3170
$ node
3172
- > require( ' url' ) .parse(' /status?name=ryan' , true)
3171
+ > url.parse(' /status?name=ryan' , true)
3173
3172
Url {
3174
3173
protocol: null,
3175
3174
slashes: null,
@@ -3767,6 +3766,7 @@ you need to implement any fall-back behaviour yourself.
3767
3766
[ `net.Socket.prototype.unref()` ] : net.html#net_socket_unref
3768
3767
[ `net.Socket` ] : net.html#net_class_net_socket
3769
3768
[ `net.connect()` ] : net.html#net_net_connect
3769
+ [ `querystring.parse()` ] : querystring.html#querystring_querystring_parse_str_sep_eq_options
3770
3770
[ `request.authority` ] : #http2_request_authority
3771
3771
[ `request.socket` ] : #http2_request_socket
3772
3772
[ `request.socket.getPeerCertificate()` ] : tls.html#tls_tlssocket_getpeercertificate_detailed
@@ -3782,6 +3782,7 @@ you need to implement any fall-back behaviour yourself.
3782
3782
[ `tls.TLSSocket` ] : tls.html#tls_class_tls_tlssocket
3783
3783
[ `tls.connect()` ] : tls.html#tls_tls_connect_options_callback
3784
3784
[ `tls.createServer()` ] : tls.html#tls_tls_createserver_options_secureconnectionlistener
3785
+ [ `url.parse()` ] : url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost
3785
3786
[ `writable.writableFinished` ] : stream.html#stream_writable_writablefinished
3786
3787
[ error code ] : #error_codes
3787
3788
[ Sensitive headers ] : #http2-sensitive-headers
0 commit comments