Boost C++ Libraries Home Libraries People FAQ More



All URLs conform to the generic syntax. Every URL is either hierarchical, or opaque, with the hierarchical URLs further distinguished by whether they are relative or absolute. Here are some examples of URLs and their identification:

Table 1.1. URL Examples



Hierarchical URL with https protocol. Resource in the HTTP protocol.


Hierarchical URL with ftp scheme. Resource in the FTP protocol.


Opaque URL with urn scheme. Identifies isbn resource.

Opaque URL with mailto scheme. Identifies e-mail address.


URL reference. Missing scheme and host.

A Protocol-Relative Link (PRL). Not a URL.

This library provides the following containers, which are capable of storing any possible URL:

These containers maintain a useful invariant: they always contain a valid URL.

Generic Syntax

This diagram shows the generic syntax which all URLs conform to:

In the sections that follow we discuss the main parts of the URL, parsing strings into the provided containers, modifying parts of the container while preserving invariants, and how to invoke common algorithms used with URLs.