Skip to main content
Http2ServerRequest.prototype.url - node__http2.d.ts - Node documentation
property Http2ServerRequest.prototype.url

Usage in Deno

```typescript import { Http2ServerRequest } from "node:node__http2.d.ts"; ```
Request URL string. This contains only the URL that is present in the actual HTTP request. If the request is: ```http GET /status?name=ryan HTTP/1.1 Accept: text/plain ``` Then `request.url` will be: ```js '/status?name=ryan' ``` To parse the url into its parts, `new URL()` can be used: ```console $ node > new URL('/status?name=ryan', 'http://example.com') URL { href: 'http://example.com/status?name=ryan', origin: 'http://example.com', protocol: 'http:', username: '', password: '', host: 'example.com', hostname: 'example.com', port: '', pathname: '/status', search: '?name=ryan', searchParams: URLSearchParams { 'name' => 'ryan' }, hash: '' } ```

Type

string