How to design URL?
- URLs should include nouns, not verbs.
- User plural nouns only for consistency (no singular nouns).
- Use HTTP methods (HTTP/1.1) to operate on these resources:
- Use HTTP response status codes to represent the outcome of operations on resources.
URI normalization
To transform a URI into a normalized URI have a Goal:
The normalization is possible to determine if two syntactically different URIs may be equivalent.
Converting percent-encoded triplets to uppercase.
http://example.com/foo%2a → http://example.com/foo%2AConverting the scheme and host to lowercase.
HTTP://User@Example.COM/Foo → http://User@example.com/FooDecoding percent-encoded triplets of unreserved characters. Percent-encoded triplets of the URI in the range of ALPHA, DIGIT, hyphen, period, underscore, or tilde ... should be decoded ...
http://example.com/%7Efoo → http://example.com/~fooRemoving dot-segment.
http://example.com/foo/./bar/baz/../qux → http://example.com/foo/bar/quxConverting an empty path to a "/" path.
http://example.com → http://example.com/Removing the default port.
http://example.com:80/ → http://example.com/
Reference [HTTP: The Definitive Guide]
Top comments (0)