URI(Uniform Resource Identifier)
URI 단어 뜻
• Uniform: 리소스 식별하는 통일된 방식
• Resource: 자원, URI로 식별할 수 있는 모든 것(제한 없음)
• Identifier: 다른 항목과 구분하는데 필요한 정보
• URL: Uniform Resource Locator
• URN: Uniform Resource Name
URL, URN 단어 뜻
• URL - Locator: 리소스가 있는 위치를 지정
• URN - Name: 리소스에 이름을 부여
• 위치는 변할 수 있지만, 이름은 변하지 않는다.
• urn:isbn:8960777331 (어떤 책의 isbn URN)
• URN 이름만으로 실제 리소스를 찾을 수 있는 방법이 보편화 되지 않음
URL 전체 문법
• scheme://[userinfo@]host[:port][/path][?query][#fragment]
• https://www.google.com:443/search?q=hello&hl=ko
• 프로토콜(https)
• 호스트명(www.google.com)
• 포트 번호(443)
• 패스(/search)
• 쿼리 파라미터(q=hello&hl=ko)
URL scheme
• scheme://[userinfo@]host[:port][/path][?query][#fragment]
• https://www.google.com:443/search?q=hello&hl=ko
• 주로 프로토콜 사용
• 프로토콜: 어떤 방식으로 자원에 접근할 것인가 하는 약속 규칙
• 예) http, https, ftp 등등
• http는 80 포트, https는 443 포트를 주로 사용, 포트는 생략 가능
• https는 http에 보안 추가 (HTTP Secure)
URL host
• scheme://[userinfo@]host[:port][/path][?query][#fragment]
• https://www.google.com:443/search?q=hello&hl=ko
• 호스트명
• 도메인명 또는 IP 주소를 직접 사용가능
URL PORT
• scheme://[userinfo@]host[:port][/path][?query][#fragment]
• https://www.google.com:443/search?q=hello&hl=ko
• 포트(PORT)
• 접속 포트
• 일반적으로 생략, 생략시 http는 80, https는 44
URL path
• scheme://[userinfo@]host[:port][/path][?query][#fragment]
• https://www.google.com:443/search?q=hello&hl=ko
• 리소스 경로(path), 계층적 구조
• 예)
• /home/file1.jpg
• /members
• /members/100, /items/iphone12
URL fragment
• scheme://[userinfo@]host[:port][/path][?query][#fragment]
• https://docs.spring.io/spring-boot/docs/current/reference/html/gettingstarted.html#getting-started-introducing-spring-boot
• fragment • html 내부 북마크 등에 사용
• 서버에 전송하는 정보 아님
웹 브라우저 요청 흐름
hello - Google 검색
HELLO! brings you the latest celebrity & royal news from the UK & around the world, magazine exclusives, fashion, beauty, lifestyle news, celeb babies, ...
www.google.com:443
hello - Google 검색
HELLO! brings you the latest celebrity & royal news from the UK & around the world, magazine exclusives, fashion, beauty, lifestyle news, celeb babies, ...
www.google.com:443
'네트워크' 카테고리의 다른 글
HTTP-비 연결성(connectionless) (0) | 2022.04.20 |
---|---|
HTTP-Stateful, Stateless (0) | 2022.04.19 |
PORT/DNS (0) | 2022.02.22 |
TCP/UDP (0) | 2022.02.21 |
IP(Internet Protocol) (0) | 2022.02.20 |