# URI

Explore what information is available for URIs.

This type denotes the location of a resource, like a webpage or an image, as defined by the [RFC 3986](https://tools.ietf.org/html/rfc3986) standard.

## Properties

These are the available properties:

- `base`: `string`

  The base of the URI. The base refers to the portion preceding the path and consists of the scheme, hostname, and port.

  Here are some examples:

  | URI                                     | Base                         |
  | --------------------------------------- | ---------------------------- |
  | `https://example.com/`                  | `"https://example.com"`      |
  | `https://example.com/path?query#anchor` | `"https://example.com"`      |
  | `https://example.com:8080/path?query`   | `"https://example.com:8080"` |

- `path`: `string`

  The path component of the URI. The path is the part that comes after the hostname and port, and before the query string.

  It is normalized to always start with a slash (/), with any additional trailing slashes removed.

  Here are some examples:

  | URI                                      | Path      |
  | ---------------------------------------- | --------- |
  | `https://example.com/`                   | `"/"`     |
  | `https://example.com/path/?query#anchor` | `"/path"` |
  | `https://example.com:8080/path?query`    | `"/path"` |
  | `https://example.com:8080/path/?query`   | `"/path"` |

- `query`: `map<string, string>`

  The query string component of the URI parsed as a map, where the keys are the parameter names and the values are the parameter values.

  The [query string](https://en.wikipedia.org/wiki/Query_string) is the part that comes after the path and starts with a question mark, and consists of key-value pairs separated by ampersands.

  Here are some examples:

  | URI                                             | Query string                        |
  | ----------------------------------------------- | ----------------------------------- |
  | `https://example.com/`                          | `[]`                                |
  | `https://example.com/path/?color=red`           | `["color": "red"]`                  |
  | `https://example.com/?color=red&size=large`     | `["color": "red", "size": "large"]` |
  | `https://example.com/?color[]=red&color[]=blue` | `["color": ["red", "blue"]]`        |

- `anchor`: `string|null`

  The fragment component of the URI, also known as the *anchor*.

  The fragment is the part that comes after the path and query string and starts with a hash.

  Here are some examples:

  | URI                                     | Anchor     |
  | --------------------------------------- | ---------- |
  | `https://example.com/`                  | `null`     |
  | `https://example.com/#hero`             | `"hero"`   |
  | `https://example.com/?color=red#colors` | `"colors"` |
