URI
约 1 分钟阅读
标签:RFC
- URI - Uniform Resource Identifier
- URL - Uniform Resource Locator
- URI > URL & URN
- List of URI schemesWikipediaList of URI schemesURI - Uniform Resource Identifier · -> URL, URN · Scheme + Resource Identifier · rfc3986 · URL - Uniform Resource Locator笔记:URI
- www.iana.org/assignments/uri-schemes/uri-schemes.xhtml
- URN - Uniform Resource Name
<URN>:<NID>:<NSS>urn:isbn:X- URN 一般为 urn
- NID - Namespace Identifier
- NSS - Namespace Specific String
- rfc2141RFCRFC 2141IETF Request for Comments standard document.RFC
- www.iana.org/assignments/urn-namespaces/urn-namespaces.xhtml
URL
┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ href │
├──────────┬──┬─────────────────────┬─────────────────────┬───────────────────────────┬────────────┤
│ protocol │ │ auth │ host │ path │ hash │
│ │ │ ├──────────────┬──────┼──────────┬────────────────┤ │
│ │ │ │ hostname │ port │ pathname │ search │ │
│ │ │ │ │ │ ├─┬──────────────┤ │
│ │ │ │ │ │ │ │ query │ │
" https: // user : pass @ sub.host.com : 8080 /p/a/t/h ? query=string #fragment "
│ │ │ │ │ hostname │ port │ │ │ │
│ │ │ │ ├──────────────┴──────┤ │ │ │
│ protocol │ │ username │ password │ host │ │ │ │
├──────────┴──┼──────────┴──────────┼─────────────────────┤ │ │ │
│ origin │ │ origin │ pathname │ search │ hash │
├─────────────┴─────────────────────┴─────────────────────┴──────────┴────────────────┴────────────┤
│ href │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘- protocol=schema
- hash=
#fragment
URL 长度限制
- 一般建议 < 2000
- cloudfront 8k - header 20k
- fastly 8Kb
- cloudflare 16k
| Browser | Address bar | document.location |
|---|---|---|
| Chrome | 32779 | >64k |
| Android | 8192 | >64k |
| Firefox | >64k | >64k |
| Safari | >64k | >64k |
| IE11 | 2047 | 5120 |
| Edge 16 | 2047 | 10240 |
References
- rfc3986RFCRFC 3986IETF Request for Comments standard document.RFC
Uniform Resource Identifier (URI): Generic Syntax
- 2005
- rfc1738RFCRFC 1738IETF Request for Comments standard document.RFC
Uniform Resource Locators (URL)
- 1994
- rfc6570RFCRFC 6570IETF Request for Comments standard document.RFC
URI Template
- 2012
- rfc8615RFCRFC 8615IETF Request for Comments standard document.RFC
Well-Known Uniform Resource Identifiers (URIs)
- 2019
/.well-known/- www.iana.org/assignments/well-known-uris/well-known-uris.xhtml
关联信息
反向链接、本文链接的其他页面和外部资料。
参考资料
GitHub1 条
- medialize/URI.jsgithub.com/medialize/URI.js
Wikipedia1 条
- List of URI schemesWikipedia:List of URI schemes
标准文档5 条
- RFC 3986datatracker.ietf.org/doc/html/rfc3986RFC
IETF Request for Comments standard document.
- RFC 1738datatracker.ietf.org/doc/html/rfc1738RFC
IETF Request for Comments standard document.
- RFC 2141datatracker.ietf.org/doc/html/rfc2141RFC
IETF Request for Comments standard document.
- RFC 6570datatracker.ietf.org/doc/html/rfc6570RFC
IETF Request for Comments standard document.
- RFC 8615datatracker.ietf.org/doc/html/rfc8615RFC
IETF Request for Comments standard document.
其他外链4 条
- url.spec.whatwg.orgurl.spec.whatwg.org/
- www.iana.org/assignments/uri-schemes/uri-schemes.xhtmlwww.iana.org/assignments/uri-schemes/uri-schemes.xhtml
- www.iana.org/assignments/urn-namespaces/urn-namespaces.xhtmlwww.iana.org/assignments/urn-namespaces/urn-namespaces.xhtml
- www.iana.org/assignments/well-known-uris/well-known-uris.xhtmlwww.iana.org/assignments/well-known-uris/well-known-uris.xhtml