What is HTTP Response
What is HTTP Response
An HTTP response is made by a server to a client. The aim of the response is to provide the client with the resource it requested, or inform the client that the action it requested has been carried out; or else to inform the client that an error occurred in processing its request. An HTTP response contains the following things.
- A status line.
- A series of HTTP headers, or header fields
- A message body, which is usually needed.
Status line: HTTP/1.1 302 Found This is how the status line of the response header looks like. It contains the HTTP protocol version, status code, Reason phrase (known as status text).
Response Header: There can be one or more response header lines and they are used to pass additional information to the client from the server.
Response Body: The response body contains the resource demanded by the client. If the request is unsuccessful then the response body contains the reason for the error, it may also contain the steps to be done by the client to complete the request successfully.