RFC 7230 (HTTP/1.1)

Hypertext Transfer Protocol (HTTP/1.1) : Message Syntax and Routing

The Hypertext Transfer Protocol (HTTP) is a stateless application-level protocol for distributed, collaborative, hypertext information systems.

1. Introduction

  • 1. โ€œMessage Syntax and Routingโ€ (ํ•ด๋‹น ๋ฌธ์„œ)

  • 2. โ€œSemantics and Contentโ€ [RFC7231]

  • 3. โ€œConditional Requestsโ€ [RFC7232]

  • 4. โ€œRange Requestsโ€ [RFC7233]

  • 5. โ€œCachingโ€ [RFC7234]

  • 6. โ€œAuthenticationโ€ [RFC7235]

2. Architecture

HTTP๋Š” World Wide Web (WWW) ์•„ํ‚คํ…์ฒ˜๋ฅผ ์œ„ํ•ด ๋งŒ๋“ค์–ด ์กŒ๊ณ , ์‹œ๊ฐ„์ด ์ง€๋‚จ์— ๋”ฐ๋ผ ์›”๋“œ ์™€์ด๋“œ ํ•˜์ดํผํ…์ŠคํŠธ ์‹œ์Šคํ…œ์˜ ํ™•์žฅ์„ฑ์— ๋Œ€ํ•œ ์š”๊ตฌ๋“ค์„ ์ง€์›ํ•˜๊ธฐ ์œ„ํ•ด ๋ฐœ์ „ํ–ˆ๋‹ค. ์•„ํ‚คํ…์ฒ˜์˜ ๋Œ€๋ถ€๋ถ„์ด ์šฉ์–ด์™€ HTTP ์ •์˜๋ฅผ ์œ„ํ•ด ์‚ฌ์šฉ๋˜๋Š” ๊ตฌ๋ฌธ๋“ค์— ๋ฐ˜์˜๋˜์—ˆ๋‹ค.

2.1 Client/Server Messaging

HTTP๋Š” ์‹ ๋ขฐ์„ฑ ์žˆ๋Š” ์ „์†ก ๊ณ„์ธต ๋˜๋Š” ์„ธ์…˜ ๊ณ„์ธต โ€œconnectionโ€์˜ (Section 6) ๋ฉ”์‹œ์ง€ ๊ตํ™˜ (Section 3)์— ์˜ํ•ด ์ž‘๋™๋˜๋Š” ์ƒํƒœ์—†๋Š” ์š”์ฒญ/์‘๋‹ต ํ”„๋กœํ† ์ฝœ์ด๋‹ค. HTTP โ€œclient(์ดํ•˜ ํด๋ผ์ด์–ธ ํŠธ)โ€ ๋Š” ํ•˜๋‚˜ ์ด์ƒ์˜ HTTP ์š”์ฒญ๋“ค์„ ์ „์†กํ•˜๊ธฐ ์œ„ํ•œ ๋ชฉ์ ์œผ๋กœ ์ปค๋„ฅ์…˜์„ ์„œ๋ฒ„์— ์„ค๋ฆฝํ•˜๋Š” ํ”„๋กœ ๊ทธ๋žจ์ด๋‹ค. HTTP โ€œserver(์ดํ•˜ ์„œ๋ฒ„)โ€๋Š” HTTP ์š”์ฒญ์„ ์ฒ˜๋ฆฌํ•˜๊ณ  HTTP ์‘๋‹ต์„ ๋ณด๋‚ด๊ธฐ ์œ„ํ•ด ์ปค๋„ฅ์…˜์„ ํ—ˆ์šฉํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์ด๋‹ค.

  • user agent(์ดํ•˜ ์‚ฌ์šฉ์ž ์—์ด์ „ํŠธ)

์š”์ฒญ์„ ์‹œ์ž‘ํ•˜๋Š” ๋‹ค์–‘ํ•œ ํด๋ผ์ด์–ธํŠธ ํ”„๋กœ๊ทธ๋žจ (๋ธŒ๋ผ์šฐ์ €, ์ŠคํŒŒ์ด๋” (์›น ๊ธฐ๋ฐ˜ ๋กœ๋ด‡), ์ปค๋งจ๋“œ ๋ผ์ธ ํˆด, ๋ชจ๋ฐ”์ผ ์•ฑ)

  • origin server(์ดํ•˜ ์›์„œ๋ฒ„)

ํŠน์ • ๋Œ€์ƒ ๋ฆฌ์†Œ์Šค์— ๋Œ€ ํ•œ ๊ถŒํ•œ ์žˆ๋Š” ์‘๋‹ต์„ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ๋Š” ํ”„๋กœ๊ทธ๋žจ

๋‹ค์Œ ์˜ˆ์‹œ๋Š” URI ์—์„œ GET ์š”์ฒญ์„ ์œ„ํ•œ ์ผ๋ฐ˜์ ์ธ ๋ฉ”์‹œ์ง€ ๊ตํ™˜์„ ๋ณด์—ฌ์ค€๋‹ค.

"http://www.example.com/hello.txt":

ํด๋ผ์ด์–ธํŠธ ์š”์ฒญ:

GET /hello.txt HTTP/1.1 User-Agent: curl/7.16.3 libcurl/7.16.3 OpenSSL/0.9.71 zlib/1.2.3 Host: www.example.com Accept-Lanuage: en, mi

์„œ๋ฒ„ ์‘๋‹ต:

HTTP/1.1 200 OK Date: Mon, 27 Jul 2009 12:28:53 GMT Server: Apache Last-Modified: Wed, 22 Jul 2009 19:15:56 GMT ETag: "34aa387-d-1568eb00" Accept-Ranges: bytes Content-Length: 51 Vary: Accept-Encoding Content-Type: text/plain Hello World! My payload includes a trailing CRLF.

2.2 Implementation Diversity

๋ณดํ†ต์˜ HTTP ์‚ฌ์šฉ์ž ์—์ด์ „ํŠธ๋Š” ๊ฐ€์ • ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜, ์Œํ–ฅ๊ธฐ๊ธฐ, ์ฒด์ค‘๊ณ„, ์Šคํฌ๋ฆฝํŠธ๋ฅผ ๊ฐฑ์‹ ํ•˜๋Š” firmware, command-line ํ”„๋กœ๊ทธ๋žจ, ๋ชจ๋ฐ”์ผ ์•ฑ, ๊ทธ๋ฆฌ๊ณ  ๋‹ค์–‘ํ•œ ๋ชจ์–‘๊ณผ ํฌ๊ธฐ์˜ ํ†ต์‹  ๊ธฐ๊ธฐ๋ฅผ ํฌํ•จํ•œ๋‹ค. ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ, ๋ณดํ†ต์˜ HTTP ์› ์„œ๋ฒ„๋Š” ํ™ˆ ์ž๋™ํ™” ์žฅ์น˜, ๋„คํŠธ์›Œํ‚น์„ ๊ตฌ์„ฑํ•˜๋Š” ๋ถ€ํ’ˆ, ์‚ฌ๋ฌด์šฉ ๊ธฐ๊ณ„, ์ž์œจ ๋กœ๋ด‡, ๋‰ด์Šค ํ”ผ๋“œ, ํŠธ๋ž˜ํ”ฝ ์นด๋ฉ”๋ผ, ๊ด‘๊ณ  ์„ ํƒ์ž, ๊ทธ๋ฆฌ๊ณ  ๋น„๋””์˜ค-๋ฐฐ์†ก ํ”Œ๋žซํผ์„ ํฌํ•จํ•œ๋‹ค.

2.3 Intermediaries (์ค‘๊ฐœ์ž)

์ค‘๊ฐœ์ž์˜ 3๊ฐ€์ง€ ํ˜•ํƒœ

  • Proxy

  • Gateway (reverse proxy)

  • Tunnel: ๋ฉ”์‹œ์ง€ ๋ณ€๊ฒฝ์—†์ด 2๊ฐœ์˜ ์ปค๋„ฅ์…˜์— ์ˆจ๊ฒจ์ง„ ์ค‘๊ฐœ์ž๋กœ์จ ์—ญํ• (ex, TLS)

์šฉ์–ด: upstream, downstream, inbound, outbound

์„œ๋ฒ„๋Š” ์ปค๋„ฅ์…˜ ์ด ๋ณด์•ˆ๋˜์–ด ์žˆ๊ณ  ํ•ด๋‹น ์—์ด์ „ํŠธ์— ํŠน์ •๋˜์–ด ์žˆ์ง€ ์•Š๋Š”ํ•œ ๋™์ผํ•œ ์ปค๋„ฅ์…˜์— ๋Œ€ํ•œ ๋‘๊ฐœ์˜ ์š”์ฒญ ์ด ๋™์ผํ•œ ์‚ฌ์šฉ์ž ์—์ด์ „ํŠธ์—์„œ ์˜จ ๊ฒƒ์œผ๋กœ ๊ฐ€์ •ํ•ด์„œ๋Š” ์•ˆ ๋œ๋‹ค. (MUST NOT)

2.4 Caches

"cache"๋Š” ์ด์ „ ์‘๋‹ต ๋ฉ”์‹œ์ง€์˜ ๋กœ์ปฌ ๋ณด๊ด€์†Œ์ด๊ณ  ๋ฉ”์‹œ์ง€์˜ ์ €์žฅ, ๊ฒ€์ƒ‰, ์‚ญ์ œ๋ฅผ ๊ด€๋ฆฌ ํ•˜๋Š” ์„œ๋ธŒ ์‹œ์Šคํ…œ์ด๋‹ค. ์บ์‹œ๋Š” ์บ์‹œ ๊ฐ€๋Šฅํ•œ ์‘๋‹ต์„ ์ €์žฅํ•˜์—ฌ ํ–ฅํ›„ ๋™์ผํ•œ ์š”์ฒญ์— ๋Œ€ํ•œ ์‘๋‹ต ์‹œ ๊ฐ„๊ณผ ๋„คํŠธ์›Œํฌ ๋Œ€์—ญํญ ์‚ฌ์šฉ์„ ์ค„์ธ๋‹ค. ์บ์‹œ๋Š” ์„œ๋ฒ„๊ฐ€ ํ„ฐ๋„ ์—ญํ• ์„ ํ•˜๋Š” ๋™์•ˆ์—๋Š” ์‚ฌ์šฉ๋  ์ˆ˜ ์—†์ง€๋งŒ ๊ทธ๊ฒƒ์„ ์ œ์™ธํ•˜๊ณ ๋Š” ํด๋ผ์ด์–ธํŠธ, ์„œ๋ฒ„ ๋ชจ๋‘์—์„œ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•˜๋‹ค.

2.5 Conformance and Error Handling

  • ๋ฐœ์‹ ์ž๋Š” ๋ฐœ์‹ ์ž๊ฐ€ ๊ฑฐ์ง“์ด๋ผ๋Š” ์˜๋ฏธ๋ฅผ ์ „๋‹ฌํ•˜๋Š” ํ”„๋กœํ† ์ฝœ ์š”์†Œ๋ฅผ ์ƒ์„ฑํ•˜๋ฉด ์•ˆ ๋œ๋‹ค.(MUST NOT)

  • ๋ฐœ์‹ ์ž๋Š” ABNF ๊ทœ์น™์— ๋Œ€์‘ํ•˜๋Š” ์ •์˜๋œ ๋ฌธ๋ฒ•์— ๋งž์ง€ ์•Š๋Š” ํ”„๋กœํ† ์ฝœ ์š”์†Œ๋ฅผ ์ƒ์„ฑํ•˜๋ฉด ์•ˆ ๋œ๋‹ค.(MUST NOT)

  • ์ง€์ •๋œ ๋ฉ”์‹œ ์ง€ ๋‚ด์—์„œ, ๋ฐœ์‹ ์ž๋Š” ๋‹ค๋ฅธ ์—ญํ• (i.e., ํ•ด๋‹น ๋ฉ”์‹œ์ง€์— ๋ฐœ์‹ ์ž์—๊ฒŒ ์—†๋Š” ์—ญํ• )์˜ ์ฐธ๊ฐ€์ž๋งŒ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ๋Š” ํ”„๋กœํ† ์ฝœ ์š”์†Œ๋‚˜ ๊ตฌ๋ฌธ ๋Œ€์•ˆ์„ ์ƒ์„ฑํ•˜๋ฉด ์•ˆ ๋œ๋‹ค.(MUST NOT)

  • ์ˆ˜์‹ ๋œ ํ”„๋กœํ† ์ฝœ ์š”์†Œ๊ฐ€ ๋ถ„์„๋˜์—ˆ์„ ๋•Œ, ์ˆ˜์‹ ์ž๋Š” ์ˆ˜์‹ ์ž์˜ ์—ญํ• ์— ํ•ด๋‹นํ•˜๋Š” ์ ์ •ํ•œ ๊ธธ์ด์˜ ๊ฐ’๊ณผ ๋ถ„์„ํ•  ์ˆ˜ ์žˆ์–ด์•ผ ํ•˜๋ฉฐ ABNF ๊ทœ์น™๋“ค์— ๋Œ€์‘ํ•˜๋Š” ์ •์˜๋œ ๋ฌธ๋ฒ•์— ์ผ์น˜ํ•ด์•ผ ํ•œ๋‹ค.(MUST)

  • ์ตœ์†Œํ•œ, ์ˆ˜์‹ ์ž๋Š” ๋‹ค๋ฅธ ๋ฉ”์‹œ์ง€์˜ ๋™์ผํ•œ ํ”„๋กœํ† ์ฝœ ์š”์†Œ์— ๋Œ€ํ•ด ์ƒ์„ฑํ•œ ๊ฐ’๋งŒํผ ํ”„๋กœํ† ์ฝœ ์š”์†Œ ๊ธธ์ด๋ฅผ ๊ตฌ๋ฌธ๋ถ„์„ํ•˜๊ณ  ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ์–ด์•ผํ•œ๋‹ค.(MUST)

  • ์ˆ˜์‹ ์ž๋Š” ์ˆ˜์‹ ์ž๊ฐ€ ํ•ด๋‹น ์˜๋ฏธ๋ก ์— ์˜ํ•ด ์•”์‹œ๋œ ๊ฒƒ์„ ์ž˜๋ชป ๊ตฌํ˜„ํ•œ๋‹ค๊ณ  (๊ฒฝํ—˜์ด๋‚˜ ๊ตฌ์„ฑ์„ ํ†ตํ•ด) ํŒ๋‹จํ•˜์ง€ ์•Š๋Š” ํ•œ, ์ˆ˜์‹ ์ž๋Š” ์ด ๋ช…์„ธ์— ์ •์˜๋œ ์˜๋ฏธ๋ก ์— ๋”ฐ๋ผ ์ˆ˜์‹ ๋œ ํ”„๋กœํ† ์ฝœ ์š”์†Œ๋ฅผ ํ•ด์„ํ•ด์•ผ ํ•œ๋‹ค.(MUST)

  • ๋‹ฌ๋ฆฌ ๋ช…์‹œ๋˜์ง€ ์•Š์€ ํ•œ, ์ˆ˜์‹ ์ž๋Š” ์ž˜๋ชป๋œ ๊ตฌ์กฐ์—์„œ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ํ”„๋กœํ† ์ฝœ ์š”์†Œ๋ฅผ ๋ณต๊ตฌํ•˜๋ ค๊ณ  ์‹œ๋„ํ•  ์ˆ˜ ์žˆ๋‹ค.(MAY)

HTTP๋Š” ๊ตฌํ˜„์˜ ๋ฌธ๋งฅ ๋ฐฐ์น˜์™€ ๋ชฉ์ ์— ๋”ฐ๋ผ ์ ์ ˆํ•œ ๊ธธ์ด๊ฐ€ ๋งค์šฐ ๋‹ค์–‘ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๋Œ€๋ถ€๋ถ„์˜ ํ”„๋กœํ† ์ฝœ ์š”์†Œ์— ๋Œ€ํ•ด ํŠน์ •ํ•œ ๊ธธ์ด ์ œํ•œ์„ ๊ฐ€์ง€๊ณ  ์žˆ์ง€ ์•Š๋Š”๋‹ค.

๋˜ํ•œ, HTTP๋Š” ๋ณด์•ˆ์— ์ง์ ‘์ ์ธ ์˜ํ–ฅ์„ ๋ฏธ์น˜๋Š” ๊ฒฝ์šฐ๋ฅผ ์ œ์™ธํ•˜๊ณ  ํŠน์ • ์˜ค๋ฅ˜ ์ฒ˜๋ฆฌ ๋ฉ”์ปค๋‹ˆ์ฆ˜์„ ์ •์˜ํ•˜์ง€ ์•Š๋Š”๋ฐ, ํ”„๋กœํ† ์ฝœ์˜ ์„œ๋กœ ๋‹ค๋ฅธ ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ์—๋Š” ๋‹ค๋ฅธ ์˜ค๋ฅ˜ ์ฒ˜๋ฆฌ ์ „๋žต ์ด ํ•„์š”ํ•˜๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค.

์˜ˆ๋ฅผ ๋“ค์–ด, ์›น ๋ธŒ๋ผ์šฐ์ €๋Š” Location ํ—ค๋” ํ•„๋“œ๊ฐ€ ABNF์— ๋”ฐ๋ผ ๊ตฌ๋ฌธ ๋ถ„์„๋˜์ง€ ์•Š๋Š” ์‘๋‹ต์—์„œ ํˆฌ๋ช…ํ•˜๊ฒŒ ๋ณต๊ตฌํ•˜๊ธฐ๋ฅผ ์›ํ•˜๋Š” ๋ฐ˜๋ฉด, ์‹œ์Šคํ…œ ์ œ์–ด ํด๋ผ์ด์–ธํŠธ๋Š” ์–ด๋–ค ํ˜• ํƒœ์˜ ์˜ค๋ฅ˜ ๋ณต๊ตฌ๋„ ์œ„ํ—˜ํ•˜๋‹ค๊ณ  ๊ฐ„์ฃผํ•  ์ˆ˜ ์žˆ๋‹ค.

2.6 Protocol Versioning

Host์™€ Connection ํ—ค๋” ํ•„๋“œ๋Š” HTTP/1.1์ค€์ˆ˜ ์—ฌ๋ถ€์— ๊ด€๊ณ„ ์—†์ด ๋ชจ๋“  HTTP/1.x๊ตฌํ˜„์— ์˜ํ•ด ๊ตฌํ˜„๋˜์–ด์•ผ ํ•œ๋‹ค.

  • HTTP ๋ฉ”์‹œ์ง€๋ฅผ ์ฒ˜๋ฆฌํ•˜๋Š” ์ค‘๊ฐœ์ž(์ฆ‰, ํ„ฐ๋„ ์—ญํ• ์„ ํ•˜๋Š” ์ค‘๊ฐœ์ž๋ฅผ ์ œ์™ธํ•œ ๋ชจ๋“  ์ค‘๊ฐœ์ž)๋Š” ์ „๋‹ฌ ๋œ ๋ฉ”์‹œ์ง€๋กœ ์ž์‹ ์˜ HTTP-version์„ ์ „์†กํ•ด์•ผ ํ•œ๋‹ค.(MUST)

  • ํด๋ผ์ด์–ธํŠธ์˜ major ๋ฒ„์ „์ด ์„œ๋ฒ„์— ์˜ํ•ด ์ง€์›ํ•˜๋Š” ๊ฐ€์žฅ ๋†’์€ ๋ฒ„์ „๋ณด๋‹ค ๋†’์ง€ ์•Š๊ณ  ํด๋ผ์ด์–ธํŠธ๊ฐ€ ๊ฐ€์žฅ ๋†’์€ ๋ฒ„์ „์„ ํ˜ธํ™˜ํ•˜๋Š” ๊ฒƒ์œผ๋กœ ์•Œ๋ ค์ ธ ์žˆ๋‹ค๋ฉด ํด๋ผ์ด์–ธํŠธ๋Š” ๊ฐ€์žฅ ๋†’์€ ๋ฒ„์ „๊ณผ ๋™์ผํ•œ ์š”์ฒญ๋ฒ„์ „์„ ์ „์†กํ•ด์•ผ ํ•œ๋‹ค.(SHOULD) ํด๋ผ์ด์–ธํŠธ๋Š” ์ ํ•ฉํ•˜์ง€ ์•Š์€ ๋ฒ„์ „์„ ๋ณด๋‚ด๋ฉด ์•ˆ๋œ๋‹ค.(MUST NOT)

  • ์„œ๋ฒ„๊ฐ€ HTTP ๊ทœ๊ฒฉ์„ ์ž˜๋ชป ๊ตฌํ˜„ํ•œ ๊ฒƒ์œผ๋กœ ์•Œ๋ ค์ง„ ๊ฒฝ์šฐ, ๊ทธ๋Ÿฌ๋‚˜ ํด๋ผ์ด์–ธํŠธ๊ฐ€ ์ ์–ด๋„ ํ•˜๋‚˜์˜ ์ •์ƒ์ ์ธ ์š”์ฒญ์„ ์‹œ๋„ํ•˜๊ณ  ์„œ๋ฒ„๊ฐ€ ์ƒ์œ„ ์š”์ฒญ ๋ฒ„์ „์„ ์ž˜๋ชป ์ฒ˜๋ฆฌํ•˜๋Š” ์‘๋‹ต ์ƒํƒœ ์ฝ”๋“œ ๋˜๋Š” ํ—ค๋” ํ•„๋“œ๋ฅผ ํ†ตํ•ด ํ™•์ธํ•œ ํ›„์—๋งŒ ํด๋ผ์ด์–ธํŠธ๊ฐ€ ํ•˜์œ„ ์š”์ฒญ ๋ฒ„์ „์„ ๋ณด๋‚ผ ์ˆ˜ ์žˆ๋‹ค.(MAY)

  • ์„œ๋ฒ„๋Š” ์„œ๋ฒ„๊ฐ€ ๊ตฌ์„ฑ๋œ ๊ฐ€์žฅ ๋†’์€ ๋ฒ„์ „๊ณผ ๋™์ผํ•œ ์‘๋‹ต ๋ฒ„์ „์„ ์ „์†กํ•ด์•ผ ํ•˜๋ฉฐ major ๋ฒ„์ „์€ ์š”์ฒญ์— ์ˆ˜์‹ ๋œ ๋ฒ„์ „๋ณด๋‹ค ์ž‘๊ฑฐ๋‚˜ ๊ฐ™์•„์•ผ ํ•œ๋‹ค.(SHOULD) ์„œ๋ฒ„๋Š” ํ˜ธํ™˜๋˜์ง€ ์•Š๋Š” ๋ฒ„์ „์„ ๋ณด๋‚ด๋ฉด ์•ˆ ๋œ ๋‹ค.(MUST NOT)

  • ํด๋ผ์ด์–ธํŠธ๊ฐ€ HTTP ์‚ฌ์–‘์„ ์ž˜๋ชป ๊ตฌํ˜„ํ•œ ๊ฒƒ์œผ๋กœ ์•Œ๋ ค์ง€๊ฑฐ๋‚˜ ์˜์‹ฌ๋˜๋Š” ๊ฒฝ์šฐ(์˜ˆ:ํด๋ผ์ด์–ธํŠธ๊ฐ€ ๋ฒ„์ „ ๋ฒˆํ˜ธ๋ฅผ ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ๊ตฌ๋ฌธ ๋ถ„์„ํ•˜์ง€ ๋ชปํ•˜๊ฑฐ๋‚˜ ์ค‘๊ฐœ์ž๊ฐ€ ํ”„๋กœํ† ์ฝœ์˜ minor ๋ฒ„์ „์ด ์ฃผ์–ด์ง„ ๊ฒƒ์„ ๋”ฐ๋ฅด์ง€ ์•Š์„ ๋•Œ HTTP ๋ฒ„์ „์„ ๋งน๋ชฉ์ ์œผ๋กœ ์ „๋‹ฌํ•˜๋Š” ๊ฒƒ์œผ๋กœ ์•Œ๋ ค์ง„ ๊ฒฝ์šฐ) ์„œ๋ฒ„๊ฐ€ ์š”์ฒญ์— ๋Œ€ํ•ด HTTP/ 1.0 ์‘๋‹ต์„ ๋ณด๋‚ผ ์ˆ˜ ์žˆ๋‹ค.(MAY) ํ•˜๋‚˜ ์ด์ƒ์˜ ์š”์ฒญ ํ—ค๋” ํ•„๋“œ(e.g., User-Agent)๊ฐ€ ์˜ค๋ฅ˜๊ฐ€ ์žˆ๋Š” ๊ฒƒ์œผ๋กœ ์•Œ๋ ค์ง„ ํด๋ผ์ด์–ธํŠธ๊ฐ€ ์ „์†กํ•œ ๊ฐ’๊ณผ ๊ณ ์œ ํ•˜๊ฒŒ ์ผ์น˜ํ•˜๋Š” ๊ฒฝ์šฐ์™€ ๊ฐ™์€ ํŠน์ • ํด๋ผ์ด์–ธํŠธ ์†์„ฑ์— ์˜ํ•ด ํŠธ๋ฆฌ๊ฑฐ ๋˜์ง€ ์•Š๋Š” ํ•œ ์ด๋Ÿฌํ•œ ํ”„๋กœํ† ์ฝœ ๋‹ค์šด๊ทธ๋ ˆ์ด๋“œ๋ฅผ ์ˆ˜ํ–‰ํ•ด์„œ๋Š” ์•ˆ ๋œ๋‹ค.(SHOULD NOT)

์–ด๋–ค ์ด์œ ๋กœ๋“  ์„œ๋ฒ„๋Š” ํด๋ผ์ด์–ธํŠธ์˜ ์ฃผ์š” ํ”„๋กœํ† ์ฝœ ๋ฒ„์ „ ์„œ๋น„์Šค๋ฅผ ๊ฑฐ๋ถ€ํ•˜๊ณ ์ž ํ•˜ ๋Š” ๊ฒฝ์šฐ 505(HTTP Version Not Supported)์˜ ์‘๋‹ต์„ ๋ณด๋‚ผ ์ˆ˜ ์žˆ๋‹ค.

2.7 Uniform Resource Identifiers

Uniform Resource Identifiers (URIs) [RFC3986]์€ ๋ฆฌ์†Œ์Šค๋ฅผ ์‹๋ณ„ํ•˜๋Š” ์ˆ˜๋‹จ์œผ๋กœ HTTP ์ „์ฒด์—์„œ ์‚ฌ์šฉ๋œ๋‹ค.

"URI-reference", "absolute-URI", โ€œrelative-part", "scheme", "authority", "port", "host", "path-abempty", โ€œsegment", "query", โ€œfragment" ์ •์˜๋Š” URI ์ผ๋ฐ˜ ๊ตฌ๋ฌธ์—์„œ ์ฑ„ํƒ๋˜์—ˆ๋‹ค.

2.7.1 http URI scheme

  • ๋ฐœ์‹ ์ž(sender)๋Š” ํ˜ธ์ŠคํŠธ ์‹๋ณ„์ž๊ฐ€ ๋น„์–ด์žˆ๋Š” ์ƒํƒœ๋กœ โ€œhttp" URI๋ฅผ ์ƒ์„ฑํ•ด์„œ๋Š” ์•ˆ ๋œ๋‹ค.(MUST NOT)

  • ์ด๋Ÿฌ ํ•œ URI ์ฐธ์กฐ๋ฅผ ์ฒ˜๋ฆฌํ•˜๋Š” ์ˆ˜์‹ ์ž๋Š” ์œ ํšจํ•˜์ง€ ์•Š์€ ๊ฒƒ์œผ๋กœ ๊ฑฐ๋ถ€ํ•ด์•ผ ํ•œ๋‹ค.(MUST)

HTTP๋Š” ์ „์†ก ํ”„๋กœํ† ์ฝœ๊ณผ ๋…๋ฆฝ์ ์ด์ง€๋งŒ, ์ด๋ฆ„ ์œ„์ž„ ํ”„๋กœ์„ธ์Šค๋Š” ๊ถŒํ•œ์„ ์„ค์ •ํ•˜๋Š” TCP์— ์˜์กดํ•˜๊ธฐ ๋•Œ๋ฌธ์— โ€œhttpโ€ scheme์€ TCP๊ธฐ๋ฐ˜ ์„œ๋น„์Šค์—๋งŒ ํ•œ์ •๋œ๋‹ค.

2.7.2 https URI scheme

โ€œhttpsโ€ URI scheme๋Š” ์ž ์žฌ์ ์œผ๋กœ HTTP ์›์„œ๋ฒ„๊ฐ€ ์ฃผ์–ด์ง„ TLS-๋ณด์•ˆ ์ปค๋„ฅ์…˜์„ ์œ„ํ•œ TCP ํฌํŠธ๋ฅผ ์ฒญ์ทจํ•˜๋Š” ๊ฒƒ์œผ๋กœ ๊ณ„์ธต์ ์œผ๋กœ ๊ด€๋ฆฌ๋œ ๋„ค์ž„ ์ŠคํŽ˜์ด์Šค์˜ ์—ฐ๊ณ„์— ๋”ฐ๋ผ ์‹๋ณ„์ž๋ฅผ ์ฃผ์กฐํ•˜๋Š” ๋ชฉ์ ์œผ๋กœ ์ •์˜ ๋œ๋‹ค.

  • TCP ํฌํŠธ 443์˜ ํฌํŠธ ํ•˜์œ„ ๊ตฌ์„ฑ ์š”์†Œ๊ฐ€ ๋น„์–ด ์žˆ๊ฑฐ๋‚˜ ์ง€์ •๋˜์ง€ ์•Š์€ ๊ฒฝ์šฐ๋ฅผ ์ œ์™ธํ•˜๊ณ  ๊ธฐ๋ณธ๊ฐ’์ด๋‹ค. ์‚ฌ์šฉ์ž ์—์ด์ „ํŠธ๋Š” ์ฒซ ๋ฒˆ์งธ HTTP ์š”์ฒญ์„ ๋ณด๋‚ด๊ธฐ ์ „์— end-to-end์˜ ๊ฐ•๋ ฅํ•œ ์•”ํ˜ธํ™” ํ†ตํ•ด ์›์„œ๋ฒ„์— ๋Œ€ํ•œ ์ปค๋„ฅ์…˜์ด ์•ˆ์ „ํ•œ์ง€ ํ™•์ธํ•ด์•ผ ํ•œ๋‹ค.(MUST)

2.7.3 http and https URI Normalization and Comparison

ํฌํŠธ๊ฐ€ scheme์˜ ๊ธฐ๋ณธํฌํŠธ์™€ ๊ฐ™๋‹ค๋ฉด, ์ผ๋ฐ˜์ ์ธ ํ˜•ํƒœ๋Š” ํฌํŠธ ํ•˜์œ„ ๊ตฌ์„ฑ์„ ์ƒ๋žตํ•˜๋Š” ๊ฒƒ์ด.

OPTIONS ์š”์ฒญ์˜ ์š”์ฒญ ๋Œ€์ƒ์œผ๋กœ absolute ํ˜•์‹์œผ๋กœ ์‚ฌ์šฉํ•˜์ง€ ์•Š์„ ๊ฒฝ์šฐ, ๋นˆ ๊ฒฝ๋กœ ๊ตฌ์„ฑ ์š”์†Œ "/"์˜ ์ ˆ๋Œ€ ๊ฒฝ๋กœ์™€ ๊ฐ™์œผ๋ฏ€๋กœ, ์ผ๋ฐ˜์ ์ธ ํ˜•์‹์€ โ€œ/" ๊ฒฝ๋กœ๋ฅผ ๋Œ€์‹  ์ œ๊ณตํ•˜๋Š” ๊ฒƒ์ด๋‹ค.

scheme ๊ณผ ํ˜ธ์ŠคํŠธ๋Š” ๋Œ€์†Œ๋ฌธ์ž๋ฅผ ๊ตฌ๋ถ„ํ•˜์ง€ ์•Š์œผ๋ฉฐ ์ผ๋ฐ˜์ ์œผ๋กœ ์†Œ๋ฌธ์ž๋กœ ์ œ๊ณต๋œ๋‹ค.

โ€œreserved" ์ง‘ํ•ฉ์— ์žˆ๋Š” ๋ฌธ์ž ์ด์™ธ์˜ ๋ฌธ์ž๋Š” ๋ฐฑ๋ถ„์œจ๋กœ ์ธ์ฝ”๋”ฉ๋œ octets์™€ ๋™์ผํ•˜๋‹ค. ์ผ๋ฐ˜์ ์ธ ํ˜•์‹์€ ํ•ด๋‹น ๋ฌธ์ž๋ฅผ ์ธ์ฝ”๋”ฉํ•˜์ง€ ์•Š๋Š”๋‹ค.([RFC3986])

๋‹ค์Œ ์„ธ๊ฐœ์˜ URI๋Š” ๋™๋“ฑํ•˜๋‹ค.

http://example.com:80/~smith/home.html

http://EXAMPLE.com/%7Esmith/home.html

http://EXAMPLE.com:/%7esmith/home.html

Last updated