HTTP header 에 대해서 알아봅시다.
- public String getHeader(String headerName)
HTTP 요청 헤더에 지정된 headerName의 값을 문자열로 리턴한다. HTTP 요청 레더에 headerName 헤더가
존재하지 않는 경우 null을 리턴한다.
(예) headerName 몇가지만 실행시켜 보면 다음과 같다.
request.getHeader("user-agent"); ← 요청 HTTP 헤더는 클라이언트 기본정보가 들어가 있다.
[출력]
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322)
HTTP 요청 헤더에 지정된 headerName의 값을 문자열로 리턴한다. HTTP 요청 레더에 headerName 헤더가
존재하지 않는 경우 null을 리턴한다.
(예) headerName 몇가지만 실행시켜 보면 다음과 같다.
request.getHeader("user-agent"); ← 요청 HTTP 헤더는 클라이언트 기본정보가 들어가 있다.
[출력]
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322)
request.getHeader("referer"); ← 이전 URL를 얻을 수 있다.
[출력]
http://www.tonkjsp.com/jsp/implicit_obj/requestTest.html
[출력]
http://www.tonkjsp.com/jsp/implicit_obj/requestTest.html
request.getHeader("cookie"); ← 쿠키 값을 가져 온다.
[출력]
JSESSIONID=2AF61AD955FB488B690A6B0DA6FCBF61
[출력]
JSESSIONID=2AF61AD955FB488B690A6B0DA6FCBF61
request.getHeader("connection"); ← 클라이언트와 서버의 연결 상태에 관한 정보 .
[출력]
Keep-Alive (유지하고 있으며 살아 있다는 의미 겠네요)
[출력]
Keep-Alive (유지하고 있으며 살아 있다는 의미 겠네요)
request.getHeader("accept-language"); ← 클라이언트에서 지금 사용하고 있는 언어
[출력]
KO (Korean , KO 한글이라는 의미 입니다.)
[출력]
KO (Korean , KO 한글이라는 의미 입니다.)
request.getHeader("accept-encoding"); ← 클라이언트의 인코딩에 관련된 정보
[출력]
gzip, deflate
[출력]
gzip, deflate
request.getHeader("accept"); ← 클라이언트가 받아 들일 수 있는 MIME 형식에 관련된 정보
[출력]
image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel,
application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
출처 :::: 아주 정리 잘되어 있음~~~ servlet 할때 참고!!!
http://blog.naver.com/donoteat84?Redirect=Log&logNo=20071353111
[출력]
image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel,
application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
출처 :::: 아주 정리 잘되어 있음~~~ servlet 할때 참고!!!
http://blog.naver.com/donoteat84?Redirect=Log&logNo=20071353111
'developer > java/javascript' 카테고리의 다른 글
window.close()할때 확인창 없이 윈도우 닫기 (0) | 2015.06.09 |
---|---|
자릿수 0으로 채우기 (0) | 2015.03.25 |
아이디, 비밀번호 쿠키에 저장하는 방법 (0) | 2014.04.15 |
window.open시 post 로 변수 보내기 + SSL 프로토콜 적용 (0) | 2014.02.27 |
천단위 금액 콤마(,) 표시 (0) | 2013.06.23 |