# Class Uri

Represents a URI.

#####
Index

### Constructors

constructor

### Properties

fragment
host
password
path
port
queryValues
scheme
user

### Accessors

authority
isAbsolute
isRelative
query

### Methods

clone
toAbsoluteUri
toString

##
Constructors

### constructor

- new Uri(uri?): Uri

- Creates a new Uri object.

  #### Parameters

  - `Optional` uri: string

    An optional string representation of a URI to build from.

  #### Returns Uri

##
Properties

### fragment

fragment: string

The fragment, also known as the hash.

### host

host: string

The host name.

### password

password: string

The user password.

### path

path: string

The path.

### port

port: string

The port.

### `Readonly` queryValues

queryValues: Map<string | number, string> = ...

Maps individual query parameters to query values. Values that don't have a key can be accessed by numeric index. The nth such query parameter will have key n (counting starts at 0). So for "?foo=1&bar&baz", queryValues will be [["foo", 1], [0, "bar"], [1, "baz"]].

### scheme

scheme: string

The scheme of the URI (also known as protocol). E.g. "http", "ftp", etc.

### user

user: string

The user name.

##
Accessors

### authority

- get authority(): string

- The authority, i.e. the combination of user info, host, and port.

  #### Returns string

### isAbsolute

- get isAbsolute(): boolean

- Determines whether this URI is absolute.

  #### Returns boolean

### isRelative

- get isRelative(): boolean

- Determines whether this URI is relative.

  #### Returns boolean

### query

- get query(): string

- The full query string.

  #### Returns string

- set query(value): void

- #### Parameters

  - value: string

  #### Returns void

##
Methods

### clone

- clone(): Uri

- Creates a deep copy of this URI.

  #### Returns Uri

### toAbsoluteUri

- toAbsoluteUri(baseUri): Uri

- Attempts to converts a URI into an absolute URI.

  #### Parameters

  - baseUri: string | Uri

    The base URI that acts as the context for a relative URI.

  #### Returns Uri

  A new Uri object that represents the transformation of the the current URI in relation to baseUri. The algorithm follows the one outlined in RFC-3986 section 5.2.2. Note that the result might not actually be an absolute URI if baseUri is not itself absolute.

### toString

- toString(): string

- Returns the string representation of this URI.

  #### Returns string