rfc 2616 http://www.rfc-editor.org/rfc/rfc2616.txt
6.1 Status-Line
response消息的第一行就是status-line,包含:http版本信息,状态码,以及该状态码相关的文本化短语,由空格隔开:
Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF6.1.1 Status Code and Reson Phrase
3位数的状态码用于响应客户端的不同request。详细讨论见章节10
状态码第一位用来标识状态码的分类:
- 1xx: Informational - Request received, continuing process - 2xx: Success - The action was successfully received, understood, and accepted - 3xx: Redirection - Further action must be taken in order to complete the request - 4xx: Client Error - The request contains bad syntax or cannot be fulfilled - 5xx: Server Error - The server failed to fulfill an apparently valid request
Status-Code = "100" ; Section 10.1.1: Continue | "101" ; Section 10.1.2: Switching Protocols | "200" ; Section 10.2.1: OK | "201" ; Section 10.2.2: Created | "202" ; Section 10.2.3: Accepted | "203" ; Section 10.2.4: Non-Authoritative Information | "