🌐

HTTP & Network Cheatsheet

HTTP status codes (2xx–5xx), common headers, CORS overview.

2xx — Success

CodeNameDescription
200OKStandard success. GET, POST, PUT responses.
201CreatedResource created. Typically after POST.
202AcceptedRequest accepted but not yet processed.
204No ContentSuccess with no response body. DELETE, PUT.
206Partial ContentRange request fulfilled (streaming, downloads).

3xx — Redirects

CodeNameDescription
301Moved PermanentlyPermanent redirect. Browsers cache.
302FoundTemporary redirect. Method may change to GET.
304Not ModifiedResource unchanged. Use cached version.
307Temporary RedirectTemporary. Method preserved (POST stays POST).
308Permanent RedirectPermanent. Method preserved.

4xx — Client Errors

CodeNameDescription
400Bad RequestMalformed request syntax or invalid parameters.
401UnauthorizedAuthentication required (not "unauthorized").
403ForbiddenAuthenticated but lacks permission.
404Not FoundResource does not exist.
405Method Not AllowedHTTP method not supported for this endpoint.
409ConflictState conflict — e.g. duplicate resource.
410GoneResource permanently deleted.
422Unprocessable EntityValidation errors on well-formed request.
429Too Many RequestsRate limit exceeded.

5xx — Server Errors

CodeNameDescription
500Internal Server ErrorGeneric unhandled server error.
501Not ImplementedMethod not supported by the server.
502Bad GatewayUpstream server sent an invalid response.
503Service UnavailableServer overloaded or in maintenance.
504Gateway TimeoutUpstream server did not respond in time.

Common HTTP Headers

HeaderDirectionPurpose
AuthorizationRequestCredentials: Bearer {token}, Basic {b64}
Content-TypeBothMIME type: application/json, text/html
AcceptRequestAcceptable response MIME types
Cache-ControlBothCaching directives: no-cache, max-age=3600
ETagResponseResource version identifier for conditional requests
LocationResponseURL for redirects or newly created resources
X-Request-IdBothCorrelation ID for tracing
CORS: Access-Control-Allow-OriginResponseAllowed request origins: *, https://example.com
← All Cheatsheets