Sintaxis URL RFC 3986
URI generic syntax componentes, delimiters, y parsing reglas per RFC 3986.
URI Components
A URI is composed of up to five components separated by specific delimiters: scheme, authority, path, query, and fragment. The authority itself contains an optional userinfo, host, and port. The scheme is case-insensitive, while the host and scheme are normalized to lowercase in practice. Each component has its own set of allowed characters and percent-encoding rules.
- scheme
- Protocol identifier before the colon
- authority
- userinfo@host:port between double slashes
- path
- Slash-separated segments after authority
- query
- Question-mark-prefixed key-value pairs
- fragment
- Hash-prefixed client-side identifier
https: //user@host:8080 /a/b/c ?q=1&r=2 #section Normalization
URI normalization produces a canonical form for comparison. Case normalization lowercases the scheme and host. Percent-encoding normalization uppercases hex digits and decodes unreserved characters. Path normalization removes dot-segments like . and .. The WHATWG URL Standard defines a stricter parsing algorithm than RFC 3986 that browsers follow, resolving some ambiguities in the RFC.
Internationalized URIs
RFC 3986 requires ASCII, so internationalized characters in the host are encoded as Punycode and other components are percent-encoded UTF-8. The IRI (Internationalized Resource Identifier) standard allows non-ASCII directly in the source form, which is converted to URI form for transmission. Browsers display the IRI form to users while resolving the ASCII URI. This dual representation requires care when comparing URIs from different sources.