POST
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since 2015ë 7ì.
HTTP POST ë©ìëë ìë²ë¡ ë°ì´í°ë¥¼ ì ì¡í©ëë¤. ìì² ë³¸ë¬¸ì ì íì Content-Type í¤ëë¡ ëíë
ëë¤.
PUTê³¼ POSTì ì°¨ì´ë 멱ë±ì±ì¼ë¡, PUTì 멱ë±ì±ì ê°ì§ëë¤. PUTì í ë²ì ë³´ë´ë, ì¬ë¬ ë²ì ì°ìì¼ë¡ ë³´ë´ë ê°ì í¨ê³¼ë¥¼ ë³´ì
ëë¤. ì¦, ë¶ì í¨ê³¼(side effect)ê° ììµëë¤.
POST ìì²ì ë³´íµ HTML ììì íµí´ ìë²ì ì ì¡íë©°, ìë²ì ë³ê²½ì¬íì ë§ëëë¤. ì´ ê²½ì°ì ì½í
ì¸ ì í(Content-Type)ì <form> ììì enctype í¹ì±ì´ë <input>, <button> ììì formenctype í¹ì± ìì ì ë¹í 문ìì´ì ë£ì´ ê²°ì í©ëë¤.
application/x-www-form-urlencoded: &ì¼ë¡ ë¶ë¦¬ëê³ , "=" 기í¸ë¡ ê°ê³¼ í¤ë¥¼ ì°ê²°íë key-value tupleë¡ ì¸ì½ë©ëë ê°ì ëë¤. ìì´ ìíë²³ì´ ìë 문ìë¤ì percent encoded ì¼ë¡ ì¸ì½ë©ë©ëë¤. ë°ë¼ì, ì´ content typeì ë°ì´ë리 ë°ì´í°ì ì¬ì©í기ìë ì ì ì¹ ììµëë¤. (ë°ì´ë리 ë°ì´í°ìë usemultipart/form-data를 ì¬ì©í´ 주ì¸ì.)_multipart/form-datatext/plain
POST ìì²ì HTML ìì ì¸ì ë¤ë¥¸ ë°©ë²(XMLHttpRequest ë±)ì¼ë¡ ì ì¡í ë ìì²ì ë³¸ë¬¸ì´ ì´ë¤ ííë ì·¨í ì ììµëë¤. HTTP 1.1 ê·ê²©ì ì ìë ë°ì ê°ì´, POSTë ë¤ìì 기ë¥ì í¬í¨íë ê· ì¼í ë©ìë를 íì©íëë¡ ì¤ê³ëììµëë¤.
- 기존 리ìì¤ì 주ìë¬ê¸°
- ê²ìí, ë´ì¤ 그룹, ë©ì¼ë§ 리ì¤í¸ë ì´ì ì ì¬í ìì¤í ì ê¸ ì¬ë¦¬ê¸°
- íìê°ì 모ë¬ë¡ ìë¡ì´ ì¬ì©ì ì¶ê°í기
- ìì ì ì¡ ê²°ê³¼ ë± ë°ì´í° ë¸ë¡ì ë°ì´í° ì²ë¦¬ íë¡ì¸ì¤ì ë³´ë´ê¸°
- ì´ì´ë¶ì´ê¸° ì°ì°ì íµí ë°ì´í°ë² ì´ì¤ íì¥
| ìì²ì 본문 ì¡´ì¬ | ì |
|---|---|
| ì±ê³µ ìëµì 본문 ì¡´ì¬ | ì |
| ìì í¨ | ìëì¤ |
| 멱ë±ì± | ìëì¤ |
| ìºì ê°ë¥ | ì ì ë ì ë³´ í¬í¨ ì |
| HTML ìììì ì¬ì© ê°ë¥ | ì |
구문
POST /index.html
ìì
ë¤ìì application/x-www-form-urlencoded ì½í
ì¸ ì íì ì¬ì©íë ê°ë¨í ííì ìì ì ì¶ ììì
ëë¤.
POST / HTTP/1.1
Host: foo.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 13
say=Hi&to=Mom
multipart/form-data ì½í
ì¸ ì íì ì¬ì©íë ììì
ëë¤.
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--
ëª ì¸
| Specification |
|---|
| HTTP Semantics > # POST > |