URI? URL? URN?
“URI는 로케이터(locator), 이름(name) 또는 둘 다 추가로 분류될 수 있다”
URI안에 URL과 URN이 있다.
URL을 주로 쓴다.
https://www.google.com/search?q=hello&hl=ko
scheme://[userinfo@]host[:port][/path][?query][#fragment]
https://www.google.com:443/search?q=hello&hl=ko
scheme://[userinfo@]host[:port][/path][?query][#fragment]
https://www.google.com:443/search?q=hello&hl=ko
scheme://[userinfo@]host[:port][/path][?query][#fragment]
https://www.google.com:443/search?q=hello&hl=ko
scheme://[userinfo@]host[:port][/path][?query][#fragment]
https://**www.google.com**:443/search?q=hello&hl=ko
scheme://[userinfo@]host[:port][/path][?query][#fragment]
https://www.google.com:**443**/search?q=hello&hl=ko
scheme://[userinfo@]host[:port][/path][?query][#fragment]
https://www.google.com:443**/search**?q=hello&hl=ko
scheme://[userinfo@]host[:port][/path][?query][#fragment]
https://www.google.com:443/search**?q=hello&hl=ko**
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
웹 브라우저에 이 URI를 검색하면 어떻게 될까?
GET /search?q=hello&hl=ko HTTP/1.1
Host: www.google.com
SOCKET 라이브러리를 통해 전달
TCP/IP 패킷 생성, HTTP 메시지 포함
2번에서 생성한 HTTP 메시지는 TCP/IP 패킷에 감싸져 있다.
TCP/IP 패킷에는 출발지 IP, PORT와 목적지 IP, PORT 등의 데이터가 있다.
이렇게 생성한 패킷을 인터넷 망에 던지고 서버로 전송한다.
google 서버에 패킷이 도착하면 서버는 TCP/IP 패킷을 까서 버리고 HTTP 메시지만 해석을 한다.(쿼리에 대한 해석)
google 서버에서 응답 메시지를 만든다.
HTTP/1.1 200 OK
Content-Type: text/html;charset=UTF-8
Content-Length: 3423
<html>
<body>...</body>
</html>