Unit 1 · Web architecture and protocols
A URL identifies a resource and often includes a scheme, host, port, path, query, and fragment. The browser resolves the host through DNS, opens a connection, sends an HTTP request, and interprets the response. HTTPS adds encryption and server authentication through TLS.
GET /courses?level=400 HTTP/1.1
Host: example.test
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: max-age=60HTTP is stateless at the protocol level: each request carries the information needed for the server to process it. Applications can add state with cookies, sessions, tokens, or a database. Use methods intentionally: GET retrieves, POST creates or triggers processing, PUT replaces, PATCH partially updates, and DELETE removes.
Status codes communicate outcome: 2xx success, 3xx redirection, 4xx client-side problem, and 5xx server-side failure. Headers carry metadata such as content type, caching, authentication, and security policy.
https://example.test:8443/catalog?tag=web#security.Cache-Control: max-age=60 is present.1. Which HTTP method is normally safe for retrieval?
2. What does a 404 indicate?
3. Why use a Content-Type header?
A strong trace identifies DNS, TLS, the request method and path, request headers, response status, response headers, and dependent asset requests. A course API might use GET /courses with 200, GET /courses/466 with 200 or 404, and POST /courses with 201 or 400. The design should explain caching and content type.