@@ -3092,12 +3092,11 @@ Then `request.url` will be:
3092
3092
' /status?name=ryan'
3093
3093
```
3094
3094
3095
- To parse the url into its parts, ` require('url').parse(request.url) `
3096
- can be used:
3095
+ To parse the url into its parts, [ ` url.parse(request.url) ` ] [ `url.parse()` ] .
3097
3096
3098
3097
``` console
3099
3098
$ node
3100
- > require( ' url' ) .parse(' /status?name=ryan' )
3099
+ > url.parse(' /status?name=ryan' )
3101
3100
Url {
3102
3101
protocol: null,
3103
3102
slashes: null,
@@ -3114,12 +3113,12 @@ Url {
3114
3113
```
3115
3114
3116
3115
To obtain the parameters from the query string, use the
3117
- ` require(' querystring') .parse()` function or pass
3118
- ` true ` as the second argument to ` require(' url') .parse()` .
3116
+ [ ` querystring.parse() ` ] [ ] function or pass
3117
+ ` true ` as the second argument to [ ` url.parse() ` ] [ ] .
3119
3118
3120
3119
``` console
3121
3120
$ node
3122
- > require( ' url' ) .parse(' /status?name=ryan' , true)
3121
+ > url.parse(' /status?name=ryan' , true)
3123
3122
Url {
3124
3123
protocol: null,
3125
3124
slashes: null,
@@ -3705,6 +3704,7 @@ following additional properties:
3705
3704
[ `net.Socket.prototype.unref()` ] : net.html#net_socket_unref
3706
3705
[ `net.Socket` ] : net.html#net_class_net_socket
3707
3706
[ `net.connect()` ] : net.html#net_net_connect
3707
+ [ `querystring.parse()` ] : querystring.html#querystring_querystring_parse_str_sep_eq_options
3708
3708
[ `request.socket` ] : #http2_request_socket
3709
3709
[ `request.socket.getPeerCertificate()` ] : tls.html#tls_tlssocket_getpeercertificate_detailed
3710
3710
[ `response.end()` ] : #http2_response_end_data_encoding_callback
@@ -3719,5 +3719,6 @@ following additional properties:
3719
3719
[ `tls.TLSSocket` ] : tls.html#tls_class_tls_tlssocket
3720
3720
[ `tls.connect()` ] : tls.html#tls_tls_connect_options_callback
3721
3721
[ `tls.createServer()` ] : tls.html#tls_tls_createserver_options_secureconnectionlistener
3722
+ [ `url.parse()` ] : url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost
3722
3723
[ error code ] : #error_codes
3723
3724
[ `writable.writableFinished` ] : stream.html#stream_writable_writablefinished
0 commit comments