<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="/transform"?>
<!--<!DOCTYPE html PUBLIC "-//W3C/DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">-->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <title>HTTP URL Path Parameter Syntax</title>
    <base href="http://doriantaylor.com/"/>
    <link rel="meta" type="application/rdf+xml" title="FOAF" href="person/dorian-taylor?type=application/rdf+xml"/>
    <link rel="alternate index" title="This Site" href="this-site"/>
    <link rel="alternate bookmark" title="Elsewhere" href="elsewhere"/>
    <link rel="up" rev="section" href="policy/http-url-path-syntax-constraints" title="HTTP URL Path Syntax Constraints" />
    <link rel="prev" rev="next" href="policy/file-extensions-in-http-url-paths" title="File Extensions in HTTP URL Paths" />
  </head>
  <body>
    <p>A <acronym title="Uniform Resource Identifier">URI</acronym> path parameter is part of a <em>path segment</em> that occurs after its <em>name</em>. Path parameters <a href="policy/uri-path-and-query-parameter-semantics" title="URI Path and Query Parameter Semantics">offer a unique opportunity</a> to control the representations of resources. Since they can't be manipulated by standard <abbr title="World Wide Web">Web</abbr> forms, they have to be constructed out of band. Since they're part of the path, they're <em>sequential</em>, <a href="policy/semantics-of-uri-query-strings" title="Semantics of URI Query Strings">unlike query strings</a>. Most importantly, however, their behaviour is not explicitly defined.</p>
    <p>When defining constraints for the syntax of path parameters, we can take these characteristics into account, and define parameters that stack sequentially, and each take multiple values.</p>
    <p>In the last paragraph of section 3.3, <a rel="external" href="http://tools.ietf.org/html/rfc3986#section-3.3" title="RFC 3986 &#x2014; Uniform Resource Identifier (URI): Generic Syntax">The <acronym title="Uniform Resource Identifier">URI</acronym> specification</a> suggests employing the semicolon <samp>;</samp>, equals <samp>=</samp> and comma <samp>,</samp> characters for this task. Therefore:</p>
    <ul>
      <li>The semicolon <samp>;</samp> will delimit the parameters themselves. That is, anything in a path segment to the right of a semicolon will be treated as a new parameter, like this: <samp>/path/name;param1;p2;p3</samp>.</li>
      <li>The equals sign <samp>=</samp> will separate parameter <em>names</em> from their <em>values</em>, should a given parameter take values. That is, within a path parameter, everything to the right of an equals sign is treated as a value, like this: <samp>param=value;p2</samp>.</li>
      <li>The comma <samp>,</samp> will separate individual <em>values</em> passed into a single parameter, like this: <samp>;param=val1,val2,val3</samp>.</li>
      <li>This means that <span class="parenthesis" title="so don't do it">although it may be visually confusing</span>, parameter <em>names</em> can take commas but no equals signs, <em>values</em> can take equals signs but no commas, and <em>no part of the path segment</em> can take semicolons literally. All other sub-delimiters should be percent-encoded.</li>
      <li>This also means that <a href="policy/other-non-alpha-numeric-characters-in-http-urls" title="Other Non-Alpha-Numeric Characters in HTTP URLs">one's opportunities for self-expression</a> with URI paths are further constrained.</li>
    </ul>
  </body>
</html>
