URI(Uniform Resource Identifier)
URI는 locator, name 또는 둘 다 추가로 분류 가능
Uniform : 리소스 식별하는 통일된 방식
Resource : 자원, URI로 식별할 수 있는 모든 것
Identifier : 다른 항목과 구분하는데 필요한 정보
URL - Locator : 리소스가 있는 위치 지정
URN - Name : 리소스에 이름 부여
>> 위치는 변할 수 있지만 이름은 변하지 않음
전체 문법
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)
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)
userinfo
scheme://[userinfo@]host[:port][/path][?query][#fragment]
URL에 사용자 정보를 포함해서 인증(거의 사용 x)
host
scheme://[userinfo@]host[:port][/path][?query][#fragment]
https://www.google.com:443/search?q=hello&hl=ko
도메인명 또는 IP 주소를 직접 사용 가능
PORT
scheme://[userinfo@]host[:port][/path][?query][#fragment]
https://www.google.com:443/search?q=hello&hl=ko
접속 포트(일반적으로 생략)
path
scheme://[userinfo@]host[:port][/path][?query][#fragment]
https://www.google.com:443/search?q=hello&hl=ko
리소스 경로, 계층적 구조
query
scheme://[userinfo@]host[:port][/path][?query][#fragment]
https://www.google.com:443/search?q=hello&hl=ko
key=value 형태
?로 시작, &로 추가 가능
fragment
scheme://[userinfo@]host[:port][/path][?query][#fragment]
html 내부 북마크 등에 사용
서버에 전송 정보 x
웹 브라우저 전송 흐름
요청 패킷이 구글 서버에 도착하면 HTTP 응답 메시지 생성 및 웹 브라우저에 다시 전달
출처 : 김영한, 모든 개발자를 위한 HTTP 웹 기본 지식
'HTTP' 카테고리의 다른 글
HTTP / HTTP 상태 코드 (0) | 2025.03.31 |
---|---|
HTTP / HTTP 메서드 활용 (0) | 2025.03.30 |
HTTP / HTTP 메서드 (0) | 2025.03.27 |
HTTP / HTTP 기본 (0) | 2025.03.26 |
HTTP / 인터넷 네트워크 (0) | 2025.03.24 |