A Status-line Zero or more header (General|Response|Entity) fields followed by CRLF An empty line (i.e., a line with nothing preceding the CRLF) indicating the end of the header fields Optionally a message-body
Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
HTTP-Version = HTTP/1.1
SN | 代码和说明 |
1 | 1xx: Informational
表示已收到请求,进程正在继续。
|
2 | 2xx: Success
表示动作被成功接收、理解和接受。
|
3 | 3xx: Redirection
这意味着必须采取进一步的行动才能完成请求。
|
4 | 4xx: Client Error
表示请求包含不正确的语法或无法完成。
|
5 | 5xx: Server Error
这意味着服务器未能满足明显有效的请求。
|
HTTP/1.1 200 OK
Date: Mon, 27 Jul 2009 12:28:53 GMT
Server: Apache/2.2.14 (Win32)
Last-Modified: Wed, 22 Jul 2009 19:15:56 GMT
Content-Length: 88
Content-Type: text/html
Connection: Closed
<html> <body> <h1>Hello, World!</h1> </body> </html>
HTTP/1.1 404 Not Found
Date: Sun, 18 Oct 2012 10:36:20 GMT
Server: Apache/2.2.14 (Win32)
Content-Length: 230
Connection: Closed
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML public "-//IETF//DTD HTML 2.0//EN"> <html> <head> <title>404 Not Found</title> </head> <body> <h1>Not Found</h1> <p>The requested URL /t.html was not found on this server.</p> </body> </html>
HTTP/1.1 400 Bad Request
Date: Sun, 18 Oct 2012 10:36:20 GMT
Server: Apache/2.2.14 (Win32)
Content-Length: 230
Content-Type: text/html; charset=iso-8859-1
Connection: Closed
<!DOCTYPE HTML public "-//IETF//DTD HTML 2.0//EN"> <html> <head> <title>400 Bad Request</title> </head> <body> <h1>Bad Request</h1> <p>Your browser sent a request that this server could not understand.</p> <p>The request line contained invalid characters following the protocol string.</p> </body> </html>