서론
- URL은 직관적이지만, 나머지 두 개념은 오래 전 정의되었고 평소 자주 접하지 않아 직관적으로 이해하기 어렵습니다. 이런 개념들이 왜 생겨났고, 정확히 어떤 표준이 존재하는지 간단히 정리해보았습니다.
URL
- URL은 네트워크(HTTP, FTP 등) 상에서 자원을 지칭(식별)할 때 사용됩니다.
- URL은 Uniform Resource Locator의 약자로, Uniform = ‘일관된, 통일된’의 의미입니다.
- 번외로, ‘Universal’으로 선택하지 않고 ‘Uniform’ 같은 추상적인 어휘를 쓴 이유는 ‘어떻게 내가 감히’ 때문이라고 합니다..!
- 참고:
Stack OverflowWhat is 'uniform' about URI, URL and URN [Uniform Resource Identifier, Uniform Resource Location, Uniform Resource Name]?![What is 'uniform' about URI, URL and URN [Uniform Resource Identifier, Uniform Resource Location, Uniform Resource Name]?](https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon@2.png?v=73d79a89bded)
What is 'uniform' about URI, URL and URN [Uniform Resource Identifier, Uniform Resource Location, Uniform Resource Name]?
I have read about the differences of the URI, URN and URL here and here but the answers talk of the differences of the last letter, that is, the differences amongst identifier, name and location
- URL 형식 = scheme + authority([username:password"@"] host [":" port]) + path + query + anchor
- 특이하게 Authority라고 부르는 이유는 사용자 정보가 포함될 수 있기 때문입니다.
- 다만 URL에 인증 정보가 노출되는 만큼 취약하기 때문에 실제로는 거의 사용되지 않습니다.
- ‘권한’이 있는 경우 예시 (http):
- 네트워크 상의 리소스 위치를 지정합니다.
https://user:password@www.example.com:8080/path?query=param#subtitle2- scheme =
https - 구분자
: - 권한
// - id =
username - 구분자
: - pw =
password - 구분자
@ - domain name =
www.example.com - 구분자
: - port =
8080 - path =
/path - query =
?query=param - anchor =
#subtitle2
- ‘권한’이 있는 다른 예시:
- ftp:
ftp://user:pass@ftp.example.com/directory/file.txt - git:
git://username@github.com:9418/user/repo.git
- ‘권한’이 없는 경우 예시:
- URL에서
//을 생략합니다. - 네트워크 상의 리소스 위치를 지정하는 대신, 데이터 자체를 포함하거나 특정 기능을 실행하는데 목적이 있기 때문에 authority 부분이 필요하지 않습니다.
- 파일:
file:///home/username/example.txt - 로컬 시스템 내의 위치만 지정합니다.
- 메일 주소:
mailto:seongbin9786@gmail.com - 주소에 바이너리 데이터를 인라인:
data:text/plain,Hello%20World - 별도의 서버 요청 없이 짧은 데이터를 직접 표시할 때 사용합니다. (이미지를 HTML에 인라인하는 등)
- 주소에 JS를 인라인:
javascript:alert('Hello');,javascript:void 0; - 전화번호:
tel:+1234567890 - 모바일 기기나 전화 연결 기능이 있는 애플리케이션에서 바로 전화를 걸 수 있게 합니다.
- ISBN URN:
urn:isbn:0451450523
- 출처
MDN Web DocsURL이란? - Web 개발 학습하기 | MDN
URL이란? - Web 개발 학습하기 | MDN
이 문서에서는 URL(Uniform Resource Locator)이 무엇이며 어떻게 구성되어 있는지 설명합니다.
Stack OverflowWhat is the difference between a URI, a URL, and a URN?
What is the difference between a URI, a URL, and a URN?
What is the difference between a URL, a URI, and a URN?
URIs, URLs, and URNs: Clarifications and Recommendations 1.0
URIs, URLs, and URNs: Clarifications and Recommendations 1.0
Copyright © 2001 W3C® (MIT, INRIA, Keio), All Rights Reserved. W3C liability, trademark, document use, and software licensing rules apply.
URN
- URN(Name)은 URL과 다르게 주소가 아닌 이름(Name)을 지정하는 것이 목적입니다.
- URN 형식 = 네임스페이스 이름 + 리소스 고유 식별자
- URL의 포맷에서 Authority(id + pw + host + port)가 없는 형태입니다.
- 단, http scheme을 사용할 때가 아니라면 path, query, anchor를 사용하는 경우가 없습니다. 리소스 고유 식별자는 scheme마다 정의된 형식을 따라갑니다.
- 주요 사용처는 ISBN, UUID, IETF RFC, ISSN 입니다.
- (ex)
urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8 - (ex)
urn:ietf:rfc:3986 - (ex)
urn:issn:0377-4929
URI
- URI(Identifier)는 URL과 URN 등장 이후 이를 통합하고자 만든 개념입니다.
- URI = scheme ":" ["//" authority] path ["?" query] ["#" fragment]
- W3C 측의 주장
- URL은 비공식적인 개념입니다. RFC 3986 상에 URL에 대한 정의가 없습니다.
- "
http:"는 URI 스킴입니다. http URI는 URL입니다. - URL은 유용하지만 비공식적인 개념입니다. URL은 다른 속성이 아닌 기본 액세스 메커니즘(예: 네트워크 "위치")의 표현을 통해 리소스를 식별하는 URI 유형입니다.
- URI, URL 간에는 대립이 존재합니다. W3C는 URL, URN 개념을 표준화한 URI를 우선적으로 사용하고, WHATWG는 URL을 우선적으로 사용합니다.
IETF DatatrackerRFC 3986: Uniform Resource Identifier (URI): Generic Syntax
RFC 3986: Uniform Resource Identifier (URI): Generic Syntax
A Uniform Resource Identifier (URI) is a compact sequence of characters that identifies an abstract or physical resource. This specification defines the generic URI syntax and a process for resolving URI references that might be in relative form, along with guidelines and security considerations for the use of URIs on the Internet. The URI syntax defines a grammar that is a superset of all valid URIs, allowing an implementation to parse the common components of a URI reference without knowing the scheme-specific requirements of every possible identifier. This specification does not define a generative grammar for URIs; that task is performed by the individual specifications of each URI scheme. [STANDARDS-TRACK]
URL Standard
URL Standard
The URL Standard defines URLs, domains, IP addresses, the application/x-www-form-urlencoded format, and their API.
Standardize on the term URL. URI and IRI are just confusing. In practice a single algorithm is used for both so keeping them distinct is not helping anyone. URL also easily wins the search result popularity contest.
- 출처
URIs, URLs, and URNs: Clarifications and Recommendations 1.0
URIs, URLs, and URNs: Clarifications and Recommendations 1.0
Copyright © 2001 W3C® (MIT, INRIA, Keio), All Rights Reserved. W3C liability, trademark, document use, and software licensing rules apply.
WikipediaList of URI schemesList of URI schemes
This article lists common URI schemes. A Uniform Resource Identifier helps identify a source without ambiguity. Many URI schemes are registered with the IANA; however, there exist many unofficial URI schemes as well. Mobile deep links are one example of a class of unofficial URI schemes that allow for linking directly to a specific location in a mobile app.
WikipediaUniform Resource IdentifierUniform Resource Identifier
A Uniform Resource Identifier (URI), formerly Universal Resource Identifier, is a unique sequence of characters that identifies an abstract or physical resource,[1] such as resources on a webpage, mail address, phone number,[2] books, real-world objects such as people and places, concepts.[3] URIs are used to identify anything described using the Resource Description Framework (RDF), for example, concepts that are part of an ontology defined using the Web Ontology Language (OWL), and people who are described using the Friend of a Friend vocabulary would each have an individual URI.