DEV Community

Gahyun Son
Gahyun Son

Posted on

Simple things to design URL

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.

  1. Converting percent-encoded triplets to uppercase.

    http://example.com/foo%2ahttp://example.com/foo%2A

  2. Converting the scheme and host to lowercase.

    HTTP://User@Example.COM/Foohttp://User@example.com/Foo

  3. Decoding 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/%7Efoohttp://example.com/~foo

  4. Removing dot-segment.

    http://example.com/foo/./bar/baz/../quxhttp://example.com/foo/bar/qux

  5. Converting an empty path to a "/" path.

    http://example.comhttp://example.com/

  6. Removing the default port.

    http://example.com:80/http://example.com/


Reference [HTTP: The Definitive Guide]

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Cloudinary image

Video API: manage, encode, and optimize for any device, channel or network condition. Deliver branded video experiences in minutes and get deep engagement insights.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay