[1] Request: Client → Server
*(( general-header ; Section 4.5
| request-header ; Section 5.3
| entity-header ) CRLF) ; Section 7.1
CRLF
[ message-body ] ; Section 4.3
Request-Line = Method SP Request-URI SP HTTP-Version CRLF
예:) GET /webmatter/235026_1.jpg HTTP/1.1[13][10]
└ Method = "OPTIONS" ; Section 9.2
| "GET" ; Section 9.3
| "HEAD" ; Section 9.4
| "POST" ; Section 9.5
| "PUT" ; Section 9.6
| "DELETE" ; Section 9.7
| "TRACE" ; Section 9.8
| "CONNECT" ; Section 9.9
general-header = Cache-Control ; Section 14.9
| Connection ; Section 14.10
| Date ; Section 14.18
| Pragma ; Section 14.32
| Trailer ; Section 14.40
| Transfer-Encoding ; Section 14.41
| Upgrade ; Section 14.42
| Via ; Section 14.45
| Warning ; Section 14.46
request-header = Accept ; Section 14.1
| Accept-Charset ; Section 14.2
| Accept-Encoding ; Section 14.3
| Accept-Language ; Section 14.4
| Authorization ; Section 14.8
| Expect ; Section 14.20
| From ; Section 14.22
| Host ; Section 14.23
| If-Match ; Section 14.24
| If-Modified-Since ; Section 14.25
| If-None-Match ; Section 14.26
| If-Range ; Section 14.27
| If-Unmodified-Since ; Section 14.28
| Max-Forwards ; Section 14.31
| Proxy-Authorization ; Section 14.34
| Range ; Section 14.35
| Referer ; Section 14.36
| TE ; Section 14.39
| User-Agent ; Section 14.43
entity-header = Allow ; Section 14.7
| Content-Encoding ; Section 14.11
| Content-Language ; Section 14.12
| Content-Length ; Section 14.13
| Content-Location ; Section 14.14
| Content-MD5 ; Section 14.15
| Content-Range ; Section 14.16
| Content-Type ; Section 14.17
| Expires ; Section 14.21
| Last-Modified ; Section 14.29
| extension-header
extension-header = message-header
GET /webmatter/235026_1.jpg HTTP/1.1CRLF
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*CRLF
Accept-Language: koCRLF
Accept-Encoding: gzip, deflateCRLF
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)CRLF
Host: localhostCRLF
Connection: Keep-AliveCRLFCRLF
[2] Response: Server → Client
*(( general-header ; Section 4.5
| response-header ; Section 6.2
| entity-header ) CRLF) ; Section 7.1
CRLF
[ message-body ] ; Section 7.2
Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
response-header = Accept-Ranges ; Section 14.5
| Age ; Section 14.6
| ETag ; Section 14.19
| Location ; Section 14.30
| Proxy-Authenticate ; Section 14.33
| Retry-After ; Section 14.37
| Server ; Section14.38
| Vary ; Section14.44
| WWW-Authenticate ; Section14.47
Status-Code 종류별 | ||
# |
종류 |
상세히 |
1xx |
Informational |
참고 정보로 클라이언트의 요청이 접수되었고 현재 처리하고 있다는 의미입니다. |
2xx |
Success |
요청 받은 것이 성공적으로 처리되었음을 나타냅니다. 이 상태 코드 클래스는 클라이언트의 요구가 성공적으로 수신, 해석 및 접수되었음을 표시합니다. |
3xx |
Redirection |
파일들이 이동되었을 때 쓰이며, 이동하는 위치를 나타내는 Location 헤더가 응답에 포함됩니다. |
4xx |
Client Error |
클라이언트의 요청이 불안전하며, 클라이언트 요청을 성공시키려면 다른 정보가 필요하다는 것을 말합니다. |
5xx |
Server Error |
서버가 에러를 발생시켰으며 요구를 처리할 능력이 없음을 인지한 경우를 표시합니다. HEAD 요구에 응답하는 때를 제외하고는 서버는 에러 상황에 대한 설명및 에러가 잠정적인지 영구적인지에 관한 상황 설명을 포함하는 엔터티를 포함해야 합니다. 사용자 에이전트는 포함된 모든 엔터티를 사용자에게 표시하여야 한다. 이러한 응답 코드는 모든 요구 method에 적용할 수 있습니다. |
Status-Code | Reason-Phrase |
100 Continue (계속)
200 OK 예를 들면: 201 Created (생성 되었음) 202 Accepted (접수 되었음) 203 Non-Authoritative Information(비 인증 정보) 204 No Content(내용이 없음) 205 Reset Content(내용을 지움) 웹브라우저가 추가적인 입력을 위해 사용된 트랜잭션을 지우는 것으로 CGI 애플리케이션에서 데이터를 입력받을때 적합합니다. 206 Partial Content(부분적 내용) 300 Multiple Choices (복수 선택) 301 Moved Permanently (영구 이동) 302 Found 303 See Other(다른 것을 참조) 304 Not Modified(변경되지 않았음)
? ETag 및/또는 Content-Location, 동일한 요구에 대한 200 응답 속에 헤더가 발송되었을 경우 ? Expires, Cache-Control, 및/또는 Vary, 동일한 변이에 대한 이전 응답 속에 발송된 field-value가 상이할 경우 304 응답이 현재 캐시 되지 않은 엔터티를 표시할 때 캐시는 이 응답을 무시하고 조건 없이 요구를 반복해야 합니다. 캐시가 수신한 304 응답을 캐시 엔트리의 갱신에 사용한다면 캐시는 응답이 가지고 있는 새로운 필드 값을 반영하기 위해 엔트리를 반드시 갱신해야 한다. 304 응답은 Message-Body를 포함해서는 안되므로 항상 헤더 필드 다음의 첫 공백 라인으로 종료되어야 합니다. 305 Use Proxy(프락시를 사용할 것) 307 Temporary Redirect(임시 이동) 400 Bad Request(잘못된 요구) 401 Unauthorized (인증되지 않았음) 402 Payment Required 403 Forbidden(금지되었음) 404 Not Found(찾을 수 없음) 405 Method Not Allowed(Method를 사용할 수 없음) 406 Not Acceptable(접수할 수 없음) 407 Proxy Authentication Required(프락시 인증 필요) 408 Request Timeout(요구 시간 초과) 409 Conflict(충돌) 410 Gone (내용물이 사라졌음) 411 Length Required(길이가 필요함) 412 Precondition Failed(사전 조건 충족 실패) 413 Request Entity Too Large(요구 엔터티가 너무 큼) 414 Request-URI Too Long(Request -URI가 너무 김) 415 Unsupported Media Type(지원되지 않는 media type) 416 Requested range not satisfiable 417 Expectation Failed 500 Internal Server Error(서버 내부 에러)
501 Not Implemented(구현되지 않았음) 502 Bad Gateway(불량 게이트웨이) 503 Service Unavailable(서비스를 사용할 수 없음) 504 Gateway Timeout(게이트웨이 시간 초과) 505 HTTP Version Not Supported(지원되지 않는 HTTP 버전) |
HTTP/1.1 200 OK <-Status-Line
Date: Wed, 08 Oct 1997 11:40:24 GMT <-general-header
Server: Apache/1.3a1 <-response-header
Last-Modified: Wed, 08 Oct 1997 11:40:06 GMT <-entity-header
ETag: "0-1e4-343b7116" <-entity-header
Content-Length: 484 <-entity-header
Accept-Ranges: bytes <-entity-header
Content-Type: text/html <-entity-header
출처: Hypertext Transfer Protocol -- HTTP/1.1 [RFC 2616]
Status Code 출처: HTTP Status Code(HTTP 1.1 : RFC 2616)