← Về trang chủ

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.

40+ codesVN explainSearch realtimeCategory filter

1xx — Informational (4)

100Continue

Server đã nhận header, client tiếp tục gửi body.

101Switching Protocols

Server đồng ý đổi protocol theo Upgrade header (vd WebSocket).

102Processing

WebDAV — server đang xử lý, chưa có response.

103Early Hints

Server gợi ý preload resources trước khi full response.

2xx — Success (5)

200OK

Request thành công. GET trả body, POST/PUT có thể trả body.

201Created

Resource đã tạo thành công (POST/PUT). Location header trỏ tới resource mới.

202Accepted

Request đã nhận, xử lý async chưa xong.

204No Content

Success, không body. Thường dùng cho DELETE / PUT idempotent.

206Partial Content

Range request — server trả 1 phần resource (video streaming, resume download).

3xx — Redirection (6)

301Moved Permanently

URL đã chuyển vĩnh viễn. Browser + Google update bookmark/index.

302Found

Redirect tạm thời. SEO không transfer juice.

303See Other

Sau POST/PUT, redirect GET đến URL khác (POST-Redirect-GET).

304Not Modified

Cache hit — resource không thay đổi từ If-Modified-Since / ETag.

307Temporary Redirect

Như 302 nhưng GIỮ method (POST vẫn POST sau redirect).

308Permanent Redirect

Như 301 nhưng giữ method. Modern API redirect.

4xx — Client Error (19)

400Bad Request

Request malformed — syntax error, JSON invalid, missing required field.

401Unauthorized

Chưa auth — thiếu/sai token. Lưu ý: nghĩa thật là 'Unauthenticated'.

402Payment Required

Cầ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 Found

Resource không tồn tại. Cũng dùng để ẩn 403 (security).

405Method Not Allowed

URL OK nhưng method (GET/POST/...) không support.

406Not Acceptable

Server không tạo được response phù hợp Accept header client.

408Request Timeout

Client gửi request quá chậm — server đóng connection.

409Conflict

Conflict với state hiện tại (vd duplicate username, version mismatch).

410Gone

Resource đã xoá vĩnh viễn. Khác 404 — không quay lại.

413Payload Too Large

Body request quá lớn (upload file vượt limit).

415Unsupported Media Type

Content-Type không support (vd POST JSON khi server cần XML).

418I'm a Teapot

RFC 2324 April Fools — server không pha cà phê. Hay được dùng làm easter egg.

422Unprocessable Entity

Request syntax OK nhưng semantic invalid (validation fail). Rails, Laravel hay dùng.

425Too Early

TLS 0-RTT replay risk — server từ chối early data.

426Upgrade Required

Client cần upgrade protocol (vd HTTPS thay vì HTTP).

428Precondition Required

Server yêu cầu If-Match / If-None-Match để tránh lost update.

429Too Many Requests

Rate limited. Check Retry-After header.

451Unavailable For Legal Reasons

Pháp lý chặn truy cập (GDPR, censorship). Reference Fahrenheit 451.

5xx — Server Error (9)

500Internal Server Error

Lỗi generic phía server. Check log để debug.

501Not Implemented

Server không support method này (vd PATCH chưa implement).

502Bad Gateway

Reverse proxy nhận response sai từ upstream. Backend down hoặc timeout.

503Service Unavailable

Server quá tải / maintenance. Check Retry-After header.

504Gateway Timeout

Proxy gateway timeout chờ upstream. Backend chậm > timeout.

505HTTP Version Not Supported

Server không support HTTP version client request.

507Insufficient Storage

WebDAV — server hết storage để store.

508Loop Detected

WebDAV — phát hiện infinite loop khi xử lý request.

511Network Authentication Required

Captive portal — cần đăng nhập WiFi/network trước.

Vì sao dùng tool này

🇻🇳
Tiếng Việt chuyên sâu

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.

🎨
Color-coded category

1xx info (blue), 2xx success (emerald), 3xx redirect (amber), 4xx client error (orange), 5xx server error (rose). Skim nhanh.

🔍
Search realtime

Gõ '40' → ra 400-451. Gõ 'redirect' → ra 301-308. Gõ 'rate' → ra 429.

Cách sử dụng

  1. 1Gõ status code, tên hoặc keyword vào search box.
  2. 2Hoặc chọn category filter (1xx-5xx).
  3. 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.