🐿 HTTP μ™„λ²½ κ°€μ΄λ“œ - 1μž₯ HTTP κ°œκ΄€

modoleeΒ·2020λ…„ 8μ›” 20일
1

HTTP μ™„λ²½ κ°€μ΄λ“œ

λͺ©λ‘ 보기
1/3
post-thumbnail

λ¦¬μ†ŒμŠ€

URI : Uniform Resource Identifier

  • URL
    • Uniform Resource Locator
    • 일반적인 μ›Ή λ¦¬μ†ŒμŠ€ μ£Όμ†Œ
  • URN
    • Uniform Resource Name
    • urn:ietf:rfc:2141 처럼 μœ μΌν•˜κ³  μœ„μΉ˜μ— 상관 없이 μ ‘κ·Ό κ°€λŠ₯ν•œ μ£Όμ†Œ

메세지

  • μ‹œμž‘ 쀄 (Start line)
    • Request : 무엇을 ν•΄μ•Ό ν•˜λŠ”μ§€ λ‚˜νƒ€λƒ„
    • Response : 무슨 일이 μΌμ–΄λ‚¬λŠ”μ§€ λ‚˜νƒ€λƒ„
  • 헀더 (HTTP headers)
    • Key : Value ν˜•νƒœλ‘œ ν•œ 쀄 λ§ˆλ‹€ ν‘œν˜„ 됨
    • λ§ˆμ§€λ§‰μ€ 빈 쀄(empty line)둜 끝남
  • λ³Έλ¬Έ (Body)
    • ν…μŠ€νŠΈ 뿐만 μ•„λ‹ˆλΌ μž„μ˜μ˜ λ°”μ΄λ„ˆλ¦¬ 데이터(이미지, λΉ„λ””μ˜€, μ˜€λ””μ˜€ λ“±...)λ₯Ό 포함할 수 있음

TCP 컀λ„₯μ…˜

Telnet을 톡해 TCP 컀λ„₯μ…˜ λ§Ίκ³  μš”μ²­ν•˜κΈ°

TCP 컀λ„₯μ…˜ λ§ΊκΈ°

  • 터미널을 μ—΄κ³  telnet info.cern.ch 80 λͺ…령을 μ‹€ν–‰
  • μ•„λž˜μ™€ 같이 λ‚˜μ˜€λ©΄μ„œ 컀λ„₯μ…˜μ΄ 맺어짐
telnet info.cern.ch 80

Trying 188.184.100.82...
Connected to webafs674.cern.ch.
Escape character is '^]'.

νŽ˜μ΄μ§€ μš”μ²­ν•˜κΈ°

  • GET λ©”μ†Œλ“œλ₯Ό ν†΅ν•΄μ„œ index.html νŒŒμΌμ„ μš”μ²­
    • μ‹œμž‘ 쀄 : λ©”μ†Œλ“œ, μš”μ²­ λ¦¬μ†ŒμŠ€, ν”„λ‘œν† μ½œ 버전
    • 헀더 : 호슀트 정보, 빈 쀄(μ€‘μš”!)
    • λ³Έλ¬Έ : μ—†μŒ
GET /index.html HTTP/1.1
Host: info.cern.ch
  • μ•„λž˜μ™€ 같은 응닡을 받을 수 있음
HTTP/1.1 200 OK
Date: Thu, 20 Aug 2020 14:47:24 GMT
Server: Apache
Last-Modified: Wed, 05 Feb 2014 16:00:31 GMT
ETag: "40521bd2-286-4f1aadb3105c0"
Accept-Ranges: bytes
Content-Length: 646
Connection: close
Content-Type: text/html

<html><head></head><body><header>
<title>http://info.cern.ch</title>
</header>

<h1>http://info.cern.ch - home of the first website</h1>
<p>From here you can:</p>
<ul>
<li><a href="http://info.cern.ch/hypertext/WWW/TheProject.html">Browse the first website</a></li>
<li><a href="http://line-mode.cern.ch/www/hypertext/WWW/TheProject.html">Browse the first website using the line-mode browser simulator</a></li>
<li><a href="http://home.web.cern.ch/topics/birth-web">Learn about the birth of the web</a></li>
<li><a href="http://home.web.cern.ch/about">Learn about CERN, the physics laboratory where the web was born</a></li>
</ul>
</body></html>
Connection closed by foreign host.
  • λΈŒλΌμš°μ €λ₯Ό ν†΅ν•΄μ„œ μ ‘μ†ν•˜λ©΄ μ•„λž˜μ™€ 같은 κ°„λ‹¨ν•œ νŽ˜μ΄μ§€

ν”„λ‘œν† μ½œ 버전

  • HTTP/0.9
  • HTTP/1.0
  • HTTP/1.0+
  • HTTP/1.1
  • HTTP/2.0

ν”„λ‘œν† μ½œ 확인 방법

  • 크둬 λΈŒλΌμš°μ € 개발자 도ꡬ > Network > 마우슀 우클릭 > Header Optionsμ—μ„œ Protocol 체크

  • h2 라고 ν‘œμ‹œλ˜λŠ” 것이 HTTP/2.0 ν”„λ‘œν† μ½œμ„ μ‚¬μš©ν•˜λŠ” 톡신

profile
κΈ°μ΄ˆκ°€ νƒ„νƒ„ν•œ λ°±μ—”λ“œ 개발자λ₯Ό κΏˆκΏ‰λ‹ˆλ‹€.

0개의 λŒ“κΈ€