Skip to main content

4.4.1. Discovering an Application's URLs

4.4.1. Discovering an Application's URLs

Generally, a client will begin interaction with a given application through the discovery of a URL. This can happen in several ways, including:

  • a URL is manually configured by the user or administrator (e.g., in a configuration file);

  • a URL is provided by a discovery mechanism (e.g., a link [WEB-LINKING] or a well-known URL [WELL-KNOWN-URI]); or

  • a URL is constructed from other information, using a template [URI-TEMPLATE] or similar.

Applications that use URLs ought to explicitly specify one or more of these mechanisms.

For example:

Clients are configured with a starting URL.

The application root is discovered using a well-known URL [WELL-KNOWN-URI].

The application uses link relations [WEB-LINKING] to navigate between resources.

Specifications SHOULD NOT define a fixed prefix for application URLs. For example, defining a protocol to always use the path prefix /app is bad practice unless that prefix is truly necessary for the application to function. Such constraints are difficult to work around if they conflict with other requirements.

However, specifications can define structure where necessary. For example, a specification might require that a resource be identified by both a category and an item identifier, with a template such as:

/{category}/{item}

In this case, the application could provide a base URL that is configurable, allowing this template to be applied below it.