In general, the server will return an HTTP response message after receiving and processing a request from the client.
The HTTP response is also made up of four parts: the status line, the message header, the blank line, and the response body.
HTTP Response message format. jpg
Example
HTTP/1.1 200 OKDate: Fri, 22 May 2009 06:07:21 GMTContent-Type: text/html; charset=UTF-8<html> <head></head> <body> <!--body goes here--> </body></html>
The first part: The status line, consists of the HTTP protocol version number, the status code, the status message three parts.
The first behavior status line, (http/1.1) indicates that the HTTP version is 1.1, the status code is 200, and the status message is (OK)
Part II: Message headers that describe some additional information that the client will use
The second line and the third behavior message header,
Date: The day and time the response was generated; Content-type: The MIME-type HTML (text/html) is specified and the encoding type is UTF-8
Part Three: blank line, a blank line after the message header is requiredPart IV: The response body, the text information that the server returns to the client.
The HTML portion following the empty line is the response body.
HTTP Response message response