Webform Notes
Technical notes / Open reference
Contents ▾
CHAPTER 02 / CONCEPTS

Understand the pieces.

HTTP gets easier when methods, resources, representations and statuses are kept distinct.

Resource versus representation

A URL identifies a resource. HTML, JSON and SVG are representations of information about that resource. The status describes the outcome of the request, not an assurance that a particular page visually loaded correctly.

Common methods

GET requests a current representation. HEAD asks for response metadata without the response content. POST submits a representation for processing; it is not simply another way to retrieve a page.

Servers should preserve expected method semantics rather than return arbitrary success for every path.

Redirects and identifiers

A 301 or 308 can indicate a permanent change in the target URI. A 302 or 307 represents a temporary redirect. Browser address bars often conceal the number of hops. Check Location and request methods when diagnosing unexpected results.

Missing is not successful

If a document does not exist, 404 Not Found is usually the correct response. A branded error document may accompany the status. Returning a generic 200 body for every unknown path makes ordinary clients and caches less reliable.