Lexicon
⌘K
Explore
ExploreGuidesNotes
WriteMy LibraryBooks
Sign in
Browse

Bug Bounty

  • Only Bug Bounty Checklist You'll Ever Need!!!
  • Only Bug Bounty Checklist You'll Ever Need!!! V2

Databases

  • Database indexing basics

DevOps

  • How environment variables work

Discussions

  • TCP somethin
  • TCP somethin
  • TCP somethin
  • TCP somethin
  • TCP somethin
  • TCP somethin
  • TCP somethin
  • TCP somethin
  • TCP somethin
  • TCP somethin
  • What's the tcp ip

Git

  • Git commands I use every day

JavaScript

  • JavaScript async and await

Kotlin

  • Kotlin coroutines overview

Linux

  • Useful Linux filesystem commands

Performance

  • How caching improves application performance

React

  • React component design principles

Reference

  • Markdown formatting reference

Software Craft

  • Clean code naming practices
  • Debugging checklist

SQL

  • SQL joins explained

Swift

  • SwiftUI state management

Web

  • API pagination patterns
  • Understanding HTTP status codes
New noteSuggest a guide

Lexicon

a personal knowledge base

← Back to note

Version history

No earlier versions yet — history builds up each time this note is edited.

Current version1 of 1

Web

Understanding HTTP status codes

Status codes are the server telling you what happened in one number. Learn the shape of each class and you can debug most APIs without reading a manual.

The five classes

RangeMeaning
1xxInformational, rarely seen directly
2xxSuccess
3xxRedirection
4xxClient error (your request was wrong)
5xxServer error (their side broke)

The mental model: 4xx means fix your request, 5xx means it is not your fault.

The ones worth memorizing

Success

  • 200 OK, the default happy path
  • 201 Created, use after a successful POST that made a resource
  • 204 No Content, success but nothing to return (common for DELETE)

Redirects

  • 301 Moved Permanently, update your bookmarks and links
  • 302 Found, temporary redirect
  • 304 Not Modified, your cached copy is still good

Client errors

  • 400 Bad Request, malformed input
  • 401 Unauthorized, you are not authenticated (misnamed, really means unauthenticated)
  • 403 Forbidden, authenticated but not allowed
  • 404 Not Found
  • 409 Conflict, e.g. a duplicate or a version clash
  • 422 Unprocessable Entity, syntactically fine but semantically invalid
  • 429 Too Many Requests, you got rate limited

Server errors

  • 500 Internal Server Error, the catch-all crash
  • 502 Bad Gateway, an upstream service returned garbage
  • 503 Service Unavailable, overloaded or down for maintenance
  • 504 Gateway Timeout, an upstream service took too long

401 vs 403

These trip people up. 401 means the server does not know who you are, so send credentials. 403 means it knows exactly who you are and the answer is still no.

Seeing them yourself

GET /api/users/42 HTTP/1.1
Host: example.com

HTTP/1.1 200 OK
Content-Type: application/json
curl -i https://example.com/api/health   # -i prints the status line and headers