URL HTTP Encoding - AFS

AFS Integration Guide

Reference Guide

HTTP URLs usage must comply to percent-encoding method.

RFC 1738 defines URL (see faqs.org, RFC 1738).

Wikipedia explain percent-encoding method (see Wikipedia, percent-encoding).

Every URL component must be encoded, in order not to contain unsupported characters or characters with a particular signification. It is easy to understand. In an HTTP URL, hostname is followed by wanted resource path.

A URL component is everything between separators. In the following example, everything in bold:


The URL of the bar.txt file located in the foobar directory is:


Example of an URL with a "/" within the directory name:

If the foobar directory was named "foo/bar", I would expect the following URL:


But in this case, there will be a conflict between "/" used as separators and the / used in the directory name. The "/" used in the directory name must be encoded as %2F.

The following URL is then properly encoded:


Example of a URL with a "+" within the query:

If my query contains the following value "My+Query", I would expect the following URL:


But in this case, when not encoded, "+" is interpreted as a space. The "afs:query=My+Query" query would be processed by AFS as "afs:query=My Query".

The "+" used within the query must be encoded as %2B, hence giving the query "My%2BQuery".

The following URL is then properly encoded: