Skip to content

HTTP Accept Header

Chrome 28.0.1500.72 m 버전에서는 웹 페이지 요청시 다음과 같이 Accept 헤더를 보낸다.

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept 헤더는 웹 브라우저가 응답을 받았을 경우에, 어떤 Content-Type 으로 해석을 할 것 인지를 결정하는 내용을 담고 있다.

위 예제의 경우에는 text/html과 application/xhtml+xml 순서대로 해석하며, 응답의 Content-Type과 맞지 않는 경우에는 q 값(기본: 1)에 따라서 높은 우선순위의 Content-Type을 선택하여 해석을 진행한다.

위 예제에서는 응답 Content-Type가 text/html이나 application/xhtml+xml이 아닌 경우에 그 다음 순위로 application/xml로 해석을 하게 된다.

HTTP Accept Header Definition: http://tools.ietf.org/html/rfc2616#section-14.1

Leave a Reply

Your email address will not be published. Required fields are marked *