HTTP ํต์ ์ ํ ๋์ ํค๋ ์ ๋ณด ์ค ํ๋.
์๋ต ํค๋(Response Header)์ media type, ์ฆ ๋ฐํ๋๋ ์ปจํ ์ธ ์ ํ์ ๋ํ๋ด๊ธฐ ์ํด ์ฌ์ฉํ๋ค.
์ฌ์ด ๋ง๋ก, ์ ์ก๋๋ ๋ฐ์ดํฐ ์ ํ(์ฃผ๋ก Body์ ๋ด๊ธด)์ด ๋ญ์ง ์๋ ค์ฃผ๋ ๊ฒ์ด๋ค.
๋๊ตฌ์๊ฒ? ๋ฐ์ดํฐ๋ฅผ ๋ฐ๋ ์ชฝ์๊ฒ! ๋ฐ์ดํฐ๋ฅผ ๋ฐ๋ ์ชฝ์ด๋, Request/Response ๋ ๋ค ํฌํจ
EX)
Content-Type: text/html; charset=utf-8
Content-Type: multipart/form-data; boundary=something
* Header๊ฐ ์์ผ๋ฉด, ๋จ์ ํ ์คํธ ๋ฐ์ดํฐ๋ก ๋ฐ๋๋ค.
* HTTPํต์ ์ค, GET๋ฐฉ์์์๋ ํ์ ํค๋ ์ ๋ณด๊ฐ ํ์ ์๊ณ , POST๋ PUT์ฒ๋ผ Body์ ๋ฐ์ดํฐ๋ฅผ ๋ณด๋ผ ๋ ํ์ํ๋ค.
type/subtype
type : ๋๋ถ๋ฅ
subtype : ์๋ถ๋ฅ
๊ฐ๋ณ ํํธ
- text : ํ ์คํธ๋ฅผ ํฌํจํ ๋ชจ๋ ๋ฌธ์ (์ธ๊ฐ readable)
- image : ๋ชจ๋ ์ข ๋ฅ์ ์ด๋ฏธ์ง (gif ํฌํจ)
- audio : ๋ชจ๋ ์ข ๋ฅ์ ์ค๋์ค ํ์ผ
- video : ๋ชจ๋ ์ข ๋ฅ์ ๋น๋์ค ํ์ผ
- application : ๋ชจ๋ ์ข ๋ฅ์ ๋ฐ์ด๋๋ฆฌ ๋ฐ์ดํฐ
EX)
Content-Type: text/plain
Content-Type: text/html
Content-Type: text/css
Content-Type: text/javascript
Content-Type: image/Jpeg
Content-Type: application/json
๋ฉํฐ ํํธ
formํ๊ทธ ์ด์ฉํ์ฌ, ๋ธ๋ผ์ฐ์ ์์ ์๋ฒ๋ก ์ ์ก ์ ์ฌ์ฉ. ํ์ผ์ด ์ฒจ๋ถ๋ ์ ์์์ ๋ช ์
EX)
Content-Type: multipart/form-data
'๐ Web > Network, Server' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[tomcat] Tomcat(ํฐ์บฃ) JAVA_HOME ์๋ ์ค์ (0) | 2022.03.16 |
---|---|
[Web] Servlet(์๋ธ๋ฆฟ) (0) | 2022.03.16 |
[Service] ์ค์ง ์ค์ธ ์๋น์ค ๊ฐ์ ๋ก Killํ๋ ๋ช ๋ น์ด (0) | 2022.02.24 |
[Server] Web Server์ Was์ ์ฐจ์ด (Apache, Tomcat?) (0) | 2022.02.20 |