Docs
Docs / Concepts

Concepts

The handful of ideas you need in your head before the rest of the documentation starts to make sense.

New here? Read this page first, then try the getting started guide. You can skip the sections you already know.

Contents

Resources

A resource is anything the server exposes at a stable address, such as a page, a document, or a record. Each resource is identified by a URL path. The same path always refers to the same resource, although its contents may change over time.

Resources are usually grouped into collections. For example, /docs/concepts is a single resource inside the /docs collection.

/docs                 collection of documentation sections
/docs/concepts        a single resource
/docs/concepts#state  a fragment inside that resource

Requests and responses

Every interaction is a request followed by a response. The client sends a method, a path, optional query parameters, and headers. The server replies with a status code, headers, and a body.

PartPurposeExample
MethodThe kind of action requestedGET, POST
PathWhich resource is addressed/docs/concepts
QueryOptional parameters that refine the request?lang=en
StatusWhether the request succeeded200 OK, 404 Not Found

GET requests should be safe to repeat. They read data and do not change it.

State and storage

HTTP is stateless. The server does not remember earlier requests unless you give it something to remember with. The common options are:

Choosing between them

Use cookies for per-browser state, such as a preferred theme. Use a database for anything that must persist or be shared, such as posts, orders, or accounts.

Errors

Errors are reported with status codes, and the body should explain what went wrong. The most common ones are listed below.

StatusMeaningWhat to check
400 Bad RequestThe request is malformedParameter names and types
401 UnauthorizedNo valid credentials were suppliedToken or session cookie
404 Not FoundNo resource exists at this pathSpelling and trailing slashes
500 Internal Server ErrorSomething failed on the serverServer logs