Bigiverse Learn
Classes

HTTP essentials

Verbs, status codes, and why a request/response contract changes how you build.

HTTP is the language of backend work. This class builds the mental model you will use for every service in the program.

The request

POST /api/v1/auth/login HTTP/1.1
Host: learn.bigiverse.com
Content-Type: application/json
Origin: http://localhost:3001

{"email":"ada@example.com","password":"s3cr3t!"}

The four parts that matter: the verb, the path, the headers, and the body. Every framework you use is just a nicer way of writing this.

The response

HTTP/1.1 200 OK
Content-Type: application/json
Set-Cookie: bl_session=…; HttpOnly; Path=/; SameSite=Lax

{"data":{"user":{"id":"…"}}}

A healthy status-code habit

  • 2xx — it worked. 200 ordinary, 201 created, 204 deleted.
  • 4xx — the caller made a mistake. Use 400 for malformed input, 401 for missing login, 403 for doing something you may not, 404 when something does not exist, 409 for conflicts, 422 for validation.
  • 5xx — the server made a mistake. 503 when a dependency is down.

Consistency matters more than cleverness: pick a convention and document it (your API contract is exactly that documentation).

The contract is the product

If your frontend and backend are separate applications, the contract between them — this is your OpenAPI document — is a small product of its own. A typed client generated from the contract turns half your runtime bugs into compile-time errors.

On this page