HTTP Status Codes — Reference 40+ Codes với Mô Tả Tiếng Việt
Tra cứu 40+ HTTP status code phổ biến (100-511) với mô tả tiếng Việt chi tiết, phân category 1xx-5xx, search realtime theo code/tên/description. Dùng cho dev debug API, hiểu response code Postman/curl.
1xx — Informational (4)
100ContinueServer đã nhận header, client tiếp tục gửi body.
101Switching ProtocolsServer đồng ý đổi protocol theo Upgrade header (vd WebSocket).
102ProcessingWebDAV — server đang xử lý, chưa có response.
103Early HintsServer gợi ý preload resources trước khi full response.
2xx — Success (5)
200OKRequest thành công. GET trả body, POST/PUT có thể trả body.
201CreatedResource đã tạo thành công (POST/PUT). Location header trỏ tới resource mới.
202AcceptedRequest đã nhận, xử lý async chưa xong.
204No ContentSuccess, không body. Thường dùng cho DELETE / PUT idempotent.
206Partial ContentRange request — server trả 1 phần resource (video streaming, resume download).
3xx — Redirection (6)
301Moved PermanentlyURL đã chuyển vĩnh viễn. Browser + Google update bookmark/index.
302FoundRedirect tạm thời. SEO không transfer juice.
303See OtherSau POST/PUT, redirect GET đến URL khác (POST-Redirect-GET).
304Not ModifiedCache hit — resource không thay đổi từ If-Modified-Since / ETag.
307Temporary RedirectNhư 302 nhưng GIỮ method (POST vẫn POST sau redirect).
308Permanent RedirectNhư 301 nhưng giữ method. Modern API redirect.
4xx — Client Error (19)
400Bad RequestRequest malformed — syntax error, JSON invalid, missing required field.
401UnauthorizedChưa auth — thiếu/sai token. Lưu ý: nghĩa thật là 'Unauthenticated'.
402Payment RequiredCần thanh toán (rare — Stripe quota dùng).
403ForbiddenĐã auth nhưng không đủ quyền. Khác 401 — không cần thử lại với token.
404Not FoundResource không tồn tại. Cũng dùng để ẩn 403 (security).
405Method Not AllowedURL OK nhưng method (GET/POST/...) không support.
406Not AcceptableServer không tạo được response phù hợp Accept header client.
408Request TimeoutClient gửi request quá chậm — server đóng connection.
409ConflictConflict với state hiện tại (vd duplicate username, version mismatch).
410GoneResource đã xoá vĩnh viễn. Khác 404 — không quay lại.
413Payload Too LargeBody request quá lớn (upload file vượt limit).
415Unsupported Media TypeContent-Type không support (vd POST JSON khi server cần XML).
418I'm a TeapotRFC 2324 April Fools — server không pha cà phê. Hay được dùng làm easter egg.
422Unprocessable EntityRequest syntax OK nhưng semantic invalid (validation fail). Rails, Laravel hay dùng.
425Too EarlyTLS 0-RTT replay risk — server từ chối early data.
426Upgrade RequiredClient cần upgrade protocol (vd HTTPS thay vì HTTP).
428Precondition RequiredServer yêu cầu If-Match / If-None-Match để tránh lost update.
429Too Many RequestsRate limited. Check Retry-After header.
451Unavailable For Legal ReasonsPháp lý chặn truy cập (GDPR, censorship). Reference Fahrenheit 451.
5xx — Server Error (9)
500Internal Server ErrorLỗi generic phía server. Check log để debug.
501Not ImplementedServer không support method này (vd PATCH chưa implement).
502Bad GatewayReverse proxy nhận response sai từ upstream. Backend down hoặc timeout.
503Service UnavailableServer quá tải / maintenance. Check Retry-After header.
504Gateway TimeoutProxy gateway timeout chờ upstream. Backend chậm > timeout.
505HTTP Version Not SupportedServer không support HTTP version client request.
507Insufficient StorageWebDAV — server hết storage để store.
508Loop DetectedWebDAV — phát hiện infinite loop khi xử lý request.
511Network Authentication RequiredCaptive portal — cần đăng nhập WiFi/network trước.
Vì sao dùng tool này
Không phải dịch máy — mỗi code có giải thích bối cảnh dev VN dùng. Vd 401 vs 403, 301 vs 302 vs 307, 422 khi nào dùng.
1xx info (blue), 2xx success (emerald), 3xx redirect (amber), 4xx client error (orange), 5xx server error (rose). Skim nhanh.
Gõ '40' → ra 400-451. Gõ 'redirect' → ra 301-308. Gõ 'rate' → ra 429.
Cách sử dụng
- 1Gõ status code, tên hoặc keyword vào search box.
- 2Hoặc chọn category filter (1xx-5xx).
- 3Đọc giải thích tiếng Việt + tham khảo khi viết API.
HTTP Status — Pick code đúng
Status code đúng là 1 phần quan trọng của REST API design. Client xử lý logic dựa trên code: 2xx = parse body, 4xx = show user error, 5xx = retry với backoff. Dùng sai code (vd trả 200 với { error: '...' }) làm client logic phức tạp, monitoring khó.
Bộ status code tool này list ra là 40+ code thường dùng (đầy đủ ~70 code trong RFC 9110, một số rất rare). Mỗi code có note tiếng Việt rõ context — 401 thường nghĩa 'chưa authenticate' không phải 'thiếu authorization', nên fix là login lại, không phải thêm role. 422 là Rails/Laravel favorite cho validation error, 400 là generic syntax error. 5xx luôn có Retry-After hoặc client tự retry với exponential backoff.
- ✓40+ status codes (RFC 9110)
- ✓Tiếng Việt + English description
- ✓Search realtime
- ✓Filter 1xx/2xx/3xx/4xx/5xx
- ✓Color-coded category
- ✓100% client-side
Câu hỏi thường gặp
200 trả về với body { success: false } có ổn không?
Không recommended. Status code dùng để client routing: 200 = success, 4xx = client error. Trả 200 với fail làm client logic phải parse body — ngược lại REST principle.
Khi nào 401 vs 403?
401 = chưa authenticate (thiếu/sai token) → client redirect login. 403 = đã authenticate nhưng không đủ permission → client hiển thị 'No access'.
301 vs 308 khác gì?
Cả 2 là permanent redirect. 301 cho phép browser convert POST → GET (RFC ambiguous). 308 BẮT BUỘC giữ method. Modern API dùng 308 cho strict redirect.