A URI path parameter is part of a path segment that occurs after its name. Path parameters offer a unique opportunity to control the representations of resources. Since they can't be manipulated by standard Web forms, they have to be constructed out of band. Since they're part of the path, they're sequential, unlike query strings. Most importantly, however, their behaviour is not explicitly defined.
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.
In the last paragraph of section 3.3, The URI specification suggests employing the semicolon ;, equals = and comma , characters for this task. Therefore:
- The semicolon ; 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: /path/name;param1;p2;p3.
- The equals sign = will separate parameter names from their values, 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: param=value;p2.
- The comma , will separate individual values passed into a single parameter, like this: ;param=val1,val2,val3.
- This means that although it may be visually confusing, parameter names can take commas but no equals signs, values can take equals signs but no commas, and no part of the path segment can take semicolons literally. All other sub-delimiters should be percent-encoded.
- This also means that one's opportunities for self-expression with URI paths are further constrained.