Click here to view code image
Content-Type: text/html
Content-Length: 35
Connection: Keep-Alive
Keep-Alive: timeout=15, max=100
The response message body contains the resource
data requested.
The following are some examples of request and
response headers:
Authorization: Carries credentials containing the authentication
information of the client for the resource being requested.
WWW-Authenticate: This is sent by the server if it needs a form of
authentication before it can respond with the actual resource being
requested. It is often sent along with response code 401, which means
“unauthorized.”
Accept-Charset: This request header tells the server which character
sets are acceptable by the client.
Content-Type: This header indicates the media type (text/HTML or
application/JSON) of the client request sent to the server by the client,
which helps process the request body correctly.
Cache-Control: This header is the cache policy defined by the server.
For this response, a cached response can be stored by the client and
reused until the time defined in the Cache-Control header.
Response Codes
The first line of a response message (that is, the status
line) contains the response status code, which the server
generates to indicate the outcome of the request. Each
status code is a three-digit number:
1xx (informational): The request was successfully received; the
server is continuing the process.
2xx (success): The request was successfully received, understood,
accepted, and serviced.
3xx (redirection): Further action must be taken to complete the
request.
4xx (client error): The request cannot be understood or is
unauthorized or the requested resource could not be found.
5xx (server error): The server failed to fulfill a request.