HTTP Messages
Find the request for a lesson in the Network panel and identify its status and Content-Type.
Understand the topic
HTTP carries requests and responses between clients and servers. A request identifies an operation and resource, and a response reports status, headers, and usually content. The textual example below illustrates HTTP/1.1; newer protocol versions use different wire formats while retaining familiar semantics. Browser developer tools show the requests needed to load HTML and its assets.
Worked example
GET /course.php?course=html HTTP/1.1
Host: 127.0.0.1:8002
Accept: text/html
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
<!doctype html>...
A 200 response indicates success, 301 or 302 indicate common redirects, 404 indicates a missing resource, and 500 indicates a server error. Inspect status and headers before debugging only the visible page.
Practice
Find the request for a lesson in the Network panel and identify its status and Content-Type.
Show a suggested answer
A rendered HTML page normally responds with a successful status and Content-Type text/html. The course topic endpoint responds with JSON instead.Common mistake
Do not confuse an HTTP status with a JavaScript application success flag. Check both where an API provides both.