• {string}

    Request URL string. This contains only the URL that is present in the actual HTTP request. If the request is:

    1. GET /status?name=ryan HTTP/1.1
    2. Accept: text/plain

    Then request.url will be:

    1. '/status?name=ryan'

    To parse the url into its parts, new URL() can be used:

    1. $ node
    2. > new URL('/status?name=ryan', 'http://example.com')
    3. URL {
    4. href: 'http://example.com/status?name=ryan',
    5. origin: 'http://example.com',
    6. protocol: 'http:',
    7. username: '',
    8. password: '',
    9. host: 'example.com',
    10. hostname: 'example.com',
    11. port: '',
    12. pathname: '/status',
    13. search: '?name=ryan',
    14. searchParams: URLSearchParams { 'name' => 'ryan' },
    15. hash: ''
    16. }