Identify the parts of an HTTP response (response code, headers, body)

📘Cisco DevNet Associate (200-901 DEVASC)


Overview

When you make a request to a server using HTTP (like a REST API call), the server sends back a response. This response tells you:

  1. Whether your request was successful.
  2. Extra details about the server or data.
  3. The data you requested (if applicable).

An HTTP response has three main parts:

  1. Response Code (Status Code)
  2. Headers
  3. Body

1. HTTP Response Code (Status Code)

The response code is a 3-digit number that tells you the result of your request. Think of it as a quick status check from the server.

Common Response Code Classes

ClassCode RangeMeaningExample Use in IT Environment
1xx100–199InformationalRarely used in APIs; server is processing your request.
2xx200–299Success200 OK → GET request returned data; 201 Created → POST request successfully created a resource.
3xx300–399Redirection301 Moved Permanently → URL changed; API clients need to follow the new URL.
4xx400–499Client Error400 Bad Request → invalid request syntax; 401 Unauthorized → missing authentication; 404 Not Found → resource doesn’t exist.
5xx500–599Server Error500 Internal Server Error → server has a problem; 503 Service Unavailable → server temporarily cannot handle requests.

Key points for the exam:

  • The first digit indicates the class (success, error, etc.).
  • You will often need to interpret the code to troubleshoot APIs.

2. HTTP Headers

Headers are metadata about the response. They are key-value pairs sent before the body. Headers don’t contain the main data, but give important info about it.

Common Headers in IT / APIs

HeaderPurposeExample
Content-TypeTells the client the format of the data in the bodyapplication/json → the body contains JSON data
Content-LengthSize of the body in bytes512 → body is 512 bytes
DateWhen the response was sentTue, 25 Feb 2026 15:30:00 GMT
ServerInformation about the server softwarenginx/1.24.0
AuthorizationTokens for APIs (if needed)Bearer <token>
Set-CookieInstructs client to store cookiessessionId=abc123; HttpOnly

Key points for the exam:

  • Headers can affect how the client processes the data.
  • They are important for authentication, caching, content format, and more.

3. HTTP Body

The body is the main content of the response. This is where the server sends the data you requested (if any).

Body Formats

  • JSON (most common for REST APIs) {
    “id”: 101,
    “name”: “Device1”,
    “status”: “active”
    }
  • XML (less common now, older APIs)
  • HTML (web pages)
  • Plain text

Body can be empty:

  • For some responses like 204 No Content, there is no body, only headers.

Key points for the exam:

  • The body contains the actual data your API call requested.
  • You need to look at headers like Content-Type to understand how to parse it.

Putting It All Together

A full HTTP response might look like this (simplified):

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 85
Date: Tue, 25 Feb 2026 15:30:00 GMT{
"deviceId": "R1",
"status": "up",
"ip": "192.168.1.1"
}
  • 200 OK → status code tells the request was successful
  • Headers → metadata (type of data, size, server info)
  • Body → actual data (device information in JSON)

Exam Tips

  1. Remember the three parts: Status Code → Headers → Body.
  2. Know the status code classes: 2xx = success, 4xx = client error, 5xx = server error.
  3. Headers give important instructions about how to read the body or handle the response.
  4. Body contains the data; it may be JSON, XML, HTML, or empty.
  5. Practice reading HTTP responses in Postman or curl so you can quickly identify each part.

This knowledge is essential for troubleshooting APIs and passing the DEVASC exam. Understanding how a server responds lets you fix errors, extract data, and automate tasks using REST APIs.

Buy Me a Coffee