URI: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 24: Line 24:
RFC 3986 defines the generic URI syntax:
RFC 3986 defines the generic URI syntax:


<font size=-2>
<font size=-1>
  scheme "://" authority "/" path [ "?" query ] [ "#" fragment ]
  scheme "://" authority "/" path [ "?" query ] [ "#" fragment ]
</font>
</font>

Revision as of 00:22, 14 February 2024

External

Internal

Overview

A Uniform Resource Identifier (URI) is a compact sequence of characters that identifies an abstract or physical resource. An URI can be a URL or an URN. Every URL is a URI, abstractly speaking, but not every URI is a URL.

REST APIs use URIs to address resources. Best Practices for Naming REST API Endpoints contains some rules to use when creating URIs for resources.

Tim Berners-Lee: "The only thing you can use an identifier for is to refer to an object. When you are not dereferencing, you should not look at the contents of the URI string to gain information". This seems to advocate for URI opacity. However, REST API designers should create URIs that convey a REST API's resource model to its clients"

Format

RFC 3986 defines the generic URI syntax:

scheme "://" authority "/" path [ "?" query ] [ "#" fragment ]