14.7 Relative URI

If a URI does not start with a scheme name, then this is called a ‘relative URI’. A relative URI is always related to some base, i.e., to some absolute URI. This base can be the URI of the displayed document or even the URI of the previous document. If there is no such URI, an implicit URI of the application can be used.

A relative URI can contain. or .. characters; they are a reference to a working or parent directory respectively. A relative URI is parsed in several independent parts: a server name, a path including a file name, a request, and a fragment. Individual parts are separated by the following characters: # (fragment), ? (query string), and so on.

Let’s take the base (which is the absolute URI) and replace its parts ...

Get Understanding TCP/IP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.