Unit content
URLs and web resources
A URL identifies a resource by describing how and where it can be addressed. A typical absolute URL is
https://example.org:443/articles?id=42#comments
Main components
This URL contains:
scheme https
host example.org
port 443
path /articles
query id=42
fragment comments
The scheme determines the addressing or access convention. The host identifies the network name, the optional port selects an application endpoint, and the path identifies a resource within the authority's namespace.
Query and fragment
The query carries additional resource parameters according to application-defined semantics.
The fragment identifies a part or view of the retrieved resource for the client. It is not normally sent as part of an HTTP request to the server.
Relative URLs
A document can refer to another resource relative to its own URL:
images/logo.png
../index.html
The client resolves the relative reference against a base URL to obtain an absolute one.
URL versus resource contents
A URL identifies or locates a resource; it is not the resource itself. The representation returned for that URL can change over time or depend on request context.
URLs provide the addressing language that links documents and HTTP interactions into the Web.