HTTP Response Body์ ์ค๋ ์ปจํ ์ธ ์ ๊ธฐ์ง/์ฑํฅ์ ์๋ ค์ฃผ๋ HTTP ํค๋ ์์ฑ์ด๋ค.
-
inline : ๋ํดํธ ๊ฐ. body์ ์๋ ๊ฐ์ด ์น ํ์ด์ง์ ํ์๋์ด์ผํ๋ค๋ ๋ป.
Content-Disposition : inline- ์ต์ ๋ธ๋ผ์ฐ์ ์์ <a> ํ๊ทธ์
download์์ฑ์Content-Disposition : inline์ผ๋ก ๊ฐ์ ธ์จ๋ค.
- ์ต์ ๋ธ๋ผ์ฐ์ ์์ <a> ํ๊ทธ์
-
attachment : body์ ์๋ ๋ฐ์ดํฐ๋ฅผ ๋ค์ด ๋ฐ์์ผํ๋ค๋ ๋ป. filename์ด ๋ช ์๋์ด์๋ค๋ฉด, ํด๋น filename์ผ๋ก ๋ค์ด ๋ฐ๋๋ค.
Content-Disposition : attachmentContent-Disposition : attachment; filename="filename.jpg" -
form-data : body๊ฐ
multipart/form-datwa์ผ ๊ฒฝ์ฐ ์ ์ฉ๋๋ค. ๋ฐ์ดํฐ๊ฐ ์ฌ๋ฌ ํํธ๋ก ๋๋ ์ ธ์ ๋ณด๋ด์ง๋๋ก ํด์ค. ๋ค์๊ณผ ๊ฐ์ด name์ผ๋ก ๋๋ ์ง ํ๋๋ฅผ ๋ํ๋ธ๋ค.POST /test.html HTTP/1.1 Host: example.org Content-Type: multipart/form-data;boundary="boundary" --boundary Content-Disposition: form-data; name="field1" value1 --boundary Content-Disposition: form-data; name="field2"; filename="example.txt" value2 --boundary--- name : ๊ฐ๋ฆฌํค๋ subpart๊ฐ ์ํ ํ๋์ ์ด๋ฆ
- ๊ฐ์ ํ๋์์ ์ฌ๋ฌ ๊ฐ์ ํ์ผ์ ๋ค๋ฃฐ ๋, ์ฌ๋ฌ๊ฐ์ subpart๊ฐ ๊ฐ์ ๊ฐ์ ๊ฐ์ง ์ ์๋ค.
- ๊ฐ์ด
_charset_์ด๋ฉด ํด๋น part๊ฐ HTML ํ๋๊ฐ ์๋๋ผ, ๋ํดํธ charset์ ์ฌ์ฉํ๊ฒ ๋ค๋ ๊ฒ์ ์๋ฏธํ๋ค.
- name : ๊ฐ๋ฆฌํค๋ subpart๊ฐ ์ํ ํ๋์ ์ด๋ฆ
์ถ์ฒ
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition