Back to All Questions
Question 11 of 100
Basic API Testing
Beginner
Q11: What is an HTTP Response? List its Key Components.
📩Core Concept
What is an HTTP Response? List its Key Components.
Key Takeaways & Architecture Summary
- ✓Status Line: HTTP protocol version, status code, and status message.
- ✓Response Headers: Server metadata (Content-Type, Cache-Control, Date).
- ✓Response Body: The serialized payload returned by the server (JSON/XML/HTML).
Direct Answer Summary
An HTTP Response is the message returned by a server to a client in response to an HTTP request. Its core components are the Status Line (containing the status code and text description), Response Headers (providing caching rules, dates, and server types), and the Response Body containing the requested data or error details.
⚠️ Senior Engineering Warning (Red Flag)
Do not assume that all successful responses have a body. For example, HTTP 204 No Content confirms success but completely omits the body payload.
💡 STAR Architectural Explanation & Pro Tip
QA engineers parse headers to verify caching policies (e.g., Cache-Control) and validate response body structures against schemas to confirm compliance.
RestAssuredTest.java
Rest-Assured + Java// Raw HTTP Response representation
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 35
{
"id": 12,
"status": "active"
}