Accept
Accept
요청 HTTP 헤더는 MIME 타입으로 표현되는, 클라이언트가 이해 가능한 컨텐츠 타입이 무엇인지를 알려줍니다. 컨텐츠 협상을 이용해, 서버는 제안 중 하나를 선택하고 사용하며 Content-Type
응답 헤더로 클라이언트에게 선택된 타입을 알려줍니다. 브라우저는 요청이 이루어진 컨텍스트에 따라 해당 헤더에 대해 적당한 값들을 설정합니다: CSS 스타일시트를 불러오게 되면, 이미지, 비디오 혹은 스크립트를 불러올 때와 다른 값이 요청에 대해 설정됩니다.
Header type | Request header |
---|---|
Forbidden header name (en-US) | no |
문법
Accept: <MIME_type>/<MIME_subtype> Accept: <MIME_type>/* Accept: */* // Multiple types, weighted with the quality value (en-US) syntax: Accept: text/html, application/xhtml+xml, application/xml;q=0.9, */*;q=0.8
디렉티브
예제
Accept: text/html Accept: image/* Accept: text/html, application/xhtml+xml, application/xml;q=0.9, */*;q=0.8
사양서
명세 | 제목 |
---|---|
RFC 7231, section 5.3.2: Accept | Hypertext Transfer Protocol (HTTP/1.1): Semantics and Context |
브라우저 호환성
BCD tables only load in the browser
함께 참고할 내용
- HTTP 컨텐츠 협상
- 컨텐츠 현상의 결과에 대한 헤더:
Content-Type
- 다른 유사한 헤더들: TE (en-US),
Accept-Encoding
,Accept-Charset
,Accept-Language