Toolman 100% local

HTTP status codes

Every status code, what triggers it, and what to actually do about it — not just the one-line definition from the spec.

1xx — Informational

The request was received and the process is continuing. These are rarely seen by application code.

CodeNameMeaning
100ContinueThe client sent an Expect: 100-continue header and the server is telling it to go ahead and send the request body.
101Switching ProtocolsThe server is switching to the protocol the client asked for in the Upgrade header — almost always a WebSocket handshake.
103Early HintsThe server is sending Link headers so the browser can start preloading critical resources before the real response is ready.

2xx — Success

The request was received, understood and accepted.

CodeNameMeaning
200OKThe request succeeded.
201CreatedThe request succeeded and a new resource was created, usually by a POST or PUT.
202AcceptedThe request was accepted for processing, but the work has not finished.
204No ContentThe request succeeded and there is deliberately no body to return.
206Partial ContentThe server is returning only part of the resource because the client sent a Range header.

3xx — Redirection

Further action is needed to complete the request — usually following a redirect.

CodeNameMeaning
301Moved PermanentlyThe resource has a new permanent URL.
302FoundA temporary redirect.
303See OtherRedirects the client to fetch the result with GET, regardless of the original method.
304Not ModifiedThe cached copy the client already has is still current, so no body is sent.
307Temporary RedirectLike 302, but guarantees the method and body are preserved.
308Permanent RedirectLike 301, but the method and body are preserved.

4xx — Client Error

The request contains something the server will not or cannot process. The fix is normally on the client side.

CodeNameMeaning
400Bad RequestThe server could not understand the request: malformed JSON, an invalid query parameter, a header that does not parse.
401UnauthorizedAuthentication is required and either missing or invalid.
403ForbiddenThe server understood the request and knows who you are, but you are not allowed to do this.
404Not FoundThe server has no resource at this URL.
405Method Not AllowedThe URL exists but does not accept this HTTP method — a POST to a GET-only endpoint, for example.
406Not AcceptableThe server cannot produce a response matching the client's Accept header.
408Request TimeoutThe client took too long to send the complete request and the server gave up waiting.
409ConflictThe request conflicts with the current state — a duplicate unique key, or an edit based on a stale version.
410GoneThe resource existed but has been deliberately and permanently removed.
413Payload Too LargeThe request body exceeds a limit the server imposes.
415Unsupported Media TypeThe server does not accept the Content-Type the client sent.
418I'm a TeapotDefined in a 1998 April Fools' RFC for the Hyper Text Coffee Pot Control Protocol.
422Unprocessable ContentThe request is syntactically valid but semantically wrong — well-formed JSON where a field fails validation.
429Too Many RequestsThe client has been rate limited.
431Request Header Fields Too LargeThe headers exceed the server's limit, usually because of oversized cookies.
451Unavailable For Legal ReasonsThe content is blocked for legal reasons — a court order, a takedown, a regional restriction.

5xx — Server Error

The server failed to fulfil an apparently valid request. The fix is on the server side.

CodeNameMeaning
500Internal Server ErrorThe server hit an unhandled error.
501Not ImplementedThe server does not support the functionality required to fulfil the request.
502Bad GatewayA server acting as a proxy got an invalid response from the upstream server.
503Service UnavailableThe server is temporarily unable to handle the request — overloaded, or down for maintenance.
504Gateway TimeoutA proxy did not get a response from the upstream server in time.
505HTTP Version Not SupportedThe server does not support the HTTP protocol version the client used.
507Insufficient StorageThe server cannot store the representation needed to complete the request.
511Network Authentication RequiredThe client must authenticate to get network access — a captive portal on hotel or airport Wi-Fi.

The four redirects, and why there are four

301 and 302 came first, and HTTP/1.1 said a user agent must not automatically redirect a non-GET request without asking the user. Browsers did something else: they redirected it silently as a GET and dropped the body. Enough of the web came to depend on that to make it unfixable, and RFC 7231 ended up documenting it as something a user agent may do “for historical reasons” — a specification conceding to what had already been built.

307 and 308 exist because of that concession. They carry the same two meanings, temporary and permanent, with the method and body guaranteed to survive rather than merely expected to.

CodeMeaningMethod afterCached by default
301PermanentPOST usually becomes GETYes
302TemporaryPOST usually becomes GETNo
307TemporaryPreservedNo
308PermanentPreservedYes

The cache column is the one that bites. A 301 or 308 is cacheable without any headers saying so, and browsers hold them hard — send one by mistake and visitors who saw it keep being redirected long after the server stopped sending it, with nothing you can do from the server side. During a migration, use 302 or 307 until you are certain, then switch to the permanent form.

For an API that redirects a POST, 307 or 308 is the only correct choice. Using 301 or 302 will silently turn the request into a GET and drop the body, and the failure shows up as a mysteriously empty request rather than as a redirect problem.

The three you will actually debug