OPTIONS
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 OPTIONS ë©ìëë 주ì´ì§ URL ëë ìë²ì ëí´ íì©ë íµì ìµì
ì ìì²í©ëë¤. í´ë¼ì´ì¸í¸ë ì´ ë°©ë²ì¼ë¡ URLì ì§ì íê±°ë ë³í(*)를 ì§ì íì¬ ì ì²´ ìë²ë¥¼ 참조í ì ììµëë¤.
| ìì²ì ë³¸ë¬¸ì´ ìì | ìëì |
|---|---|
| ì±ê³µì ì¸ ìëµì ë³¸ë¬¸ì´ ìì | ì |
| ìì í¨ | ì |
| 멱ë±ì± | ì |
| ìºì ê°ë¥ | ìëì |
| HTML í¼ìì íì©ë¨ | ìëì |
구문
OPTIONS /index.html HTTP/1.1
OPTIONS * HTTP/1.1
ìì
>íì©ë ìì² ë©ìë ìë³í기
ìë²ê° ì§ìíë ìì² ë°©ë²ì ì°¾ì¼ë ¤ë©´ ìëì ê°ì´ curl ëª
ë ¹ì´ì ì¬ì©íì¬ OPTIONS ìì²ì ë³´ë´ë³¼ ì ììµëë¤.
curl -X OPTIONS https://example.org -i
ê·¸ë¼ ìëµì íì©ë ë©ìë를 ê°ì§ê³ ìë Allow í¤ëê° ììµëë¤.
HTTP/1.1 204 No Content
Allow: OPTIONS, GET, HEAD, POST
Cache-Control: max-age=604800
Date: Thu, 13 Oct 2016 11:45:00 GMT
Server: EOS (lax004/2813)
CORS ì¬ì ìì²
CORSìì ì¬ì ìì²ì OPTIONS ë©ìë를 íµí´ ì ì¡ëë¯ë¡ ìì²ì ë³´ë¼ ì ìë ê²½ì°ë¼ë©´ ìë²ê° ìëµí ì ììµëë¤. ì´ë² ìì ììë ë¤ì 매ê°ë³ìì ëí ê¶íì ìì²í©ëë¤.
- ì¬ì ìì²ìì ì ì¡ëë
Access-Control-Request-Methodí¤ëë ìë²ì ì¤ì ìì²ì´ ì ì¡ë ëPOSTë©ìëê° ììì ìë ¤ì¤ëë¤. Access-Control-Request-Headersí¤ëë ìë²ì ì¤ì ìì²ì´ ì ì¡ë ëX-PINGOTHERìContent-Typeí¤ëê° ììì ìë ¤ì¤ëë¤.
OPTIONS /resources/post-here/ HTTP/1.1
Host: bar.example
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Connection: keep-alive
Origin: https://foo.example
Access-Control-Request-Method: POST
Access-Control-Request-Headers: X-PINGOTHER, Content-Type
ì´ì ìë²ë ìëì ê°ì ìí©ìì ìì²ì ìë½í ë ìëµí ì ììµëë¤. ì´ ìì ìì¸ ìë²ì ìëµì ë¤ìê³¼ ê°ìµëë¤.
Access-Control-Allow-Origin-
https://foo.exampleì¶ì²ë ë¤ìì íµí´bar.example/resources/post-here/URLì ìì²í ì ììµëë¤. Access-Control-Allow-Methods-
POST,GET그리ê³OPTIONSë ì´ URLì íì©ëë ë©ìëì ëë¤. (ì´ í¤ëëAllowí¤ëì ì ì¬íì§ë§ CORSìë§ ì¬ì©ë©ëë¤.) Access-Control-Allow-Headers-
X-PINGOTHERë°Content-Typeì URLì ëí´ íì©ëë ìì² í¤ëì ëë¤. Access-Control-Max-Age-
ì ê¶íì 86,400ì´(1ì¼) ëì ìºìë ì ììµëë¤.
HTTP/1.1 200 OK
Date: Mon, 01 Dec 2008 01:15:39 GMT
Server: Apache/2.0.61 (Unix)
Access-Control-Allow-Origin: https://foo.example
Access-Control-Allow-Methods: POST, GET, OPTIONS
Access-Control-Allow-Headers: X-PINGOTHER, Content-Type
Access-Control-Max-Age: 86400
Vary: Accept-Encoding, Origin
Keep-Alive: timeout=2, max=100
Connection: Keep-Alive
ìí ì½ë
200 OKì 204 No Content 모ë íì©ëë ìí ì½ëì´ì§ë§ ì¼ë¶ ë¸ë¼ì°ì ë 204 No Contentê° ì¤ì 리ìì¤ì ì ì©ëë¤ê³ ì못 íë¨íì¬ ë¦¬ìì¤ë¥¼ ê°ì ¸ì¤ê¸° ìí ë¤ì ìì²ì ë³´ë´ì§ ììµëë¤.
ëª ì¸ì
| Specification |
|---|
| HTTP Semantics > # OPTIONS > |