Skip to content
BENIBIX Learn

HTTP Response

Infrastructure🌐 NetworkingRequests and Responses

Also known as Response, Web Response

The message a server sends back. It has a code and the thing you asked for.

Think of it like

Think of it like the plate that comes back from the kitchen. A note on it says all went well.

Example

Emma's server answers with 200 OK. A header says the file is HTML, and then the menu page follows.

Why it matters

The response tells you if a request worked and why not. It is the first place to look when a page breaks.

Definition

An HTTP response is the message a server sends back after a request. Its first line holds a status code, like 200 for OK or 404 for not found. Then come headers, such as what kind of file it is and how long to keep it. Last comes the body, which is the page, the picture or the data that was asked for. The browser reads the code first to know what happened.

Example code

http
HTTP/1.1 200 OK
Content-Type: text/html

<h1>Menu</h1>
All went well. Here is an HTML page with a heading.

Common mistake

Sending back 200 OK with an error message in the body. Tools and apps then think it worked.

Key takeaways

  1. 1
    Status code first. Says what happened.
  2. 2
    Headers. File type, caching and more.
  3. 3
    Body. The content that was asked for.

Learn it properly