블로그 이미지

suddiyo


꾸준히 기록하고 성장하는 백엔드 개발자 💻
Today
-
Yesterday
-
Total
-

ABOUT ME

-

  • [Spring] 리소스를 식별하는 통일된 방식 | URI, URL, URN
    Spring 2023. 3. 2. 14:18
    https://www.ietf.org/rfc/rfc3986.txt

    1.1.3. URI, URL, and URN A URI can be further classified as a locator, a name, or both. The term "Uniform Resource Locator" (URL) refers to the subset of URIs that, in addition to identifying a resource, provide a means of locating the resource by describing its primary access mechanism (e.g., its network "location"). The term "Uniform Resource Name" (URN) has been used historically to refer to both URIs under the "urn" scheme [RFC2141], which are required to remain globally unique and persistent even when the resource ceases to exist or becomes unavailable, and to any other URI with the properties of a name. An individual scheme does not have to be classified as being just one of "name" or "locator". Instances of URIs from any given scheme may have the characteristics of names or locators or both, often depending on the persistence and care in the assignment of identifiers by the naming authority, rather than on any quality of the scheme. Future specifications and related documentation should use the general term "URI" rather than the more restrictive terms "URL" and "URN" [RFC3305].

     

    🔎 URI

    • Uniform: 리소스 식별하는 통일된 방식
    • Resource: 자원, URI로 식별할 수 있는 모든 것 (제한 X)
    • Identifier: 다른 항목과 구분하는데 필요한 정보

    - URI는 로케이터(locator), 이름(name) 또는 둘 다 추가로 분류될 수 있다.

    - URI: resource 자체를 식별하는 방법

           1) URL(Resource Locator): resource의 위치

           2) URN(Resource Name): resource의 이름

    - 위치는 변할 수 있지만, 이름은 변하지 않는다.

     

    🔎 URL

    scheme://[userinfo@]host[:port][/path][?query][#fragment]

     

    scheme

    - 주로 프로토콜 사용 ex) http, https, ftp ...

    - https는 http에 보안 추가 (HTTP Secure)

     

    userinfo

    - URL에 사용자 정보를 포함해서 인증

    - 거의 사용X

     

    host

    - 호스트명

    - 도메인명 또는 IP 주소 직접 사용 가능

     

    port

    - 일반적으로 생략 (http - 80, https - 443)

     

    path

    - 리소스 경로(path)

    - 계층적 구조

     

    query

    - key = value 형태

    - ?로 시작, &로 추가

    - query parameter, query string 등으로 불림

    - 웹서버에 제공하는 파라미터, 문자 형태

     

    fragment

    - html 내부 북마크 등에 사용

    - 서버에 전송하는 정보 X

     

     

     

     

     

     

     

     

     

     

    * 본 포스팅은 인프런 김영한님의 강의를 참고하여 작성한 글입니다.
    728x90

    댓글

Designed by Tistory.