URI(Uniform Resource Identifier) - URL, URN
by rlaehddnd0422URI ( Uniform Resource Identifier )
리μμ€λ₯Ό μλ³νλ ν΅ν©λ λ°©λ²μΌλ‘ Locator, Name λλ μΆκ°λ‘ λΆλ₯λ μ μλ€.
- Uniform : 리μμ€ μλ³νλ ν΅μΌλ λ°©μ
- Resource : μμ, URIλ‘ μλ³ν μ μλ λͺ¨λ κ² (μ ν X)
- Identifier : λ€λ₯Έ νλͺ©κ³Ό ꡬλΆλλλ° νμν μ 보
- URL : Uniform Resource Locator - 리μμ€κ° μλ μμΉλ₯Ό μ§μ
- URN : Uniform Resource Name - 리μμ€μ μ΄λ¦μ λΆμ¬
- μμΉλ λ³ν μ μμ§λ§, μ΄λ¦μ λ³νμ§ μμ
- URIμ URLμ κ°μ μλ―Έλ‘ λ΄λ 무방
URL μ 체 λ¬Έλ²
scheme :// [userinfo@] host [:port]/ [/path][?query][#fragment]
https :// www.google.com:443 /search?q=hello&hl=ko
1. scheme ( https )
- μ£Όλ‘ νλ‘ν μ½ μ¬μ©
- http λ 80, httpsλ 443, μ£Όλ‘ μλ΅ κ°λ₯νλ€
- httpsλ httpμ 보μμ μΆκ°ν νλ‘ν μ½
2. userinfo@
- URLμ μ¬μ©μ μ 보λ₯Ό ν¬ν¨ν΄μ μΈμ¦. κ±°μ μ¬μ© X
3. host ( www.google.com )
- νΈμ€νΈλͺ
- λλ©μΈλͺ λλ IPμ£Όμ μ§μ μ¬μ©κ°λ₯
4. PORT (:443)
- μ μν¬νΈλ‘ μΌλ°μ μΌλ‘ μλ΅
5. path ( search )
- 리μμ€ κ²½λ‘λ‘ κ³μΈ΅μ ꡬ쑰λ₯Ό κ°μ§
ex) /members/100
6. query (?q=hello&hl=ko)
- key=value νν
- ?λ‘ μμ, &λ‘ μΆκ°κ°λ₯ ?keyA=valueA&keyB=valueB
7. #fragment
- html λ΄λΆ λΆλ§ν¬ λ±μ μ¬μ©
- μλ²μ μ μ‘νλ μ λ³΄κ° μλ.
ex) https://docs.spring.io/spring-boot/docs/current/reference/html/getting-started.html#getting-started-introducing-spring-boot
μΉ λΈλΌμ°μ μμ² νλ¦
1. μΉ λΈλΌμ°μ κ° HTTP μμ² λ©μμ§ μμ±
GET /serach?q=hello&hl=ko HTTP/1.1
Host: www.google.com
2. μμΌ λΌμ΄λΈλ¬λ¦¬λ₯Ό ν΅ν΄ TCP/IPμ μ λ¬
- TCP/IP μ°κ²° ( IP, PORTλ₯Ό ν΅ν΄ ) - > μ λ¬ κ°μ²΄μ handshakeνμ¬ μ°κ²°
- λ°μ΄ν° μ λ¬
3. TCP/IP ν¨ν· μμ±, HTTP λ©μμ§ ν¬ν¨
- μΆλ°/λͺ©μ μ§ IP,PORT μ μ‘λ°μ΄ν°λ₯Ό ν¬ν¨ν TCP/IP ν¨ν·μ μμ±ν΄μ μ λ¬
4. μλ²μμ ν΄λΌμ΄μΈνΈμ HTTP μλ΅ λ©μμ§ λ¦¬ν΄
HTTP/1.1 200 OK
Content-Type: text/html;charset=UTF-8 Content-Length: 3423
<html> <body>...</body>
</html>
'π CS > HTTP' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
HTTP μνμ½λ / 1~5XX (0) | 2023.02.16 |
---|---|
HTTP λ©μλ νμ© (0) | 2023.02.15 |
HTTP λ©μλ - GET, POST, PUT, PATCH, DELETE in Start line (0) | 2023.02.15 |
HTTP ( HyperText Transfer Protocol) (0) | 2023.02.15 |
μΈν°λ· λ€νΈμν¬ ν΅μ - IP, TCP/UDP, PORT, DNS (0) | 2023.02.14 |
λΈλ‘κ·Έμ μ 보
Study Repository
rlaehddnd0422