diff --git a/doc/api/http.md b/doc/api/http.md index 422c5d160bf3b5..4ceebe16c3fe6b 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -2101,8 +2101,7 @@ added: v0.1.90 **Only valid for request obtained from [`http.Server`][].** Request URL string. This contains only the URL that is present in the actual -HTTP request. If the request is (remember, each header line ends with `\r\n` -plus a final `\r\n` after the last one indicating the end of the header): +HTTP request. Take the following request: ```http GET /status?name=ryan HTTP/1.1 diff --git a/doc/api/http2.md b/doc/api/http2.md index 2f9e4f0f84dd7b..e17b65cf806574 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -3034,8 +3034,7 @@ added: v8.4.0 * {string} Request URL string. This contains only the URL that is present in the actual -HTTP request. If the request is (remember, each header line ends with `\r\n` -plus a final `\r\n` after the last one indicating the end of the header): +HTTP request. If the request is: ```http GET /status?name=ryan HTTP/1.1 @@ -3049,7 +3048,7 @@ Then `request.url` will be: '/status?name=ryan' ``` -To parse the url into its parts `require('url').parse(request.url)` +To parse the url into its parts, `require('url').parse(request.url)` can be used: ```console