HTTP Status Code Reference
Complete HTTP status code reference with plain-English explanations, common causes, fix suggestions, and Laravel response helper equivalents for every code.
No matching status codes.
The request never reached your server. Check DNS, firewall, load balancer, and Nginx/Caddy configuration.
| Operation | Method | Success | Laravel |
|---|---|---|---|
| List resources | GET | 200 | response()->json($collection) |
| Get single resource | GET | 200 | response()->json($item) |
| Create resource | POST | 201 | response()->json($item, 201) |
| Full update | PUT | 200 | response()->json($updated) |
| Partial update | PATCH | 200 | response()->json($updated) |
| Delete resource | DELETE | 204 | response()->noContent() |
HTTP Status Code Reference & Lookup
HTTP status codes are three-digit numbers returned by web servers to indicate whether a request succeeded or failed, and why. They are grouped into five classes: 1xx (informational), 2xx (success), 3xx (redirection), 4xx (client error), and 5xx (server error). Understanding them is essential for debugging APIs, configuring web servers, and building correct REST endpoints. This free reference covers all standard HTTP status codes with plain-English descriptions, common causes, fixes, and the equivalent Laravel helper for each.
The most important status codes for web developers
The codes you'll encounter most often: 200 OK - request succeeded; 201 Created - POST request created a new resource; 204 No Content - DELETE succeeded, no body; 301 Moved Permanently - SEO-safe redirect (passes link equity); 302 Found - temporary redirect; 400 Bad Request - malformed syntax or invalid parameters; 401 Unauthorized - missing or invalid credentials; 403 Forbidden - authenticated but not authorised; 404 Not Found - resource doesn't exist; 422 Unprocessable Entity - validation failed; 429 Too Many Requests - rate limit hit; 500 Internal Server Error - unhandled exception on the server; 503 Service Unavailable - server is down for maintenance or overloaded.
Frequently Asked Questions
What is the difference between 401 and 403?
401 Unauthorized means the server doesn't know who the client is - no credentials were provided, or the provided credentials are invalid. The client should authenticate and try again. 403 Forbidden means the server knows who the client is (authenticated) but that user doesn't have permission for the requested resource. Returning 403 for an unauthenticated request reveals the resource exists; some APIs return 404 instead to obscure its existence. In Laravel: abort(401) vs abort(403), or use Gates/Policies which throw AuthorizationException (converts to 403).
What is the difference between 301 and 302 redirects?
A 301 Moved Permanently tells browsers and search engines that the resource has permanently moved - browsers cache the redirect, and search engines transfer "link equity" (SEO value) to the new URL. A 302 Found is a temporary redirect - browsers don't cache it, and search engines keep crawling the original URL. Use 301 for permanent URL restructuring (domain migration, removing trailing slashes). Use 302 for A/B testing, maintenance pages, or feature flags. Incorrect use of 302 for permanent moves can hurt SEO.
What does HTTP 422 Unprocessable Entity mean in Laravel?
422 is returned by Laravel when a Form Request or $request->validate() call fails. The response body contains a JSON object with a errors key mapping field names to arrays of error messages. For API requests (those sending Accept: application/json), Laravel automatically returns JSON. For browser requests, it redirects back with the errors flashed to the session. Some older APIs incorrectly return 400 for validation failures - 422 is semantically more precise (syntax was valid, but the content failed business rules).
Why does my API return 500 in production but not locally?
A 500 error means an unhandled exception occurred. In production, Laravel's APP_DEBUG=false hides exception details (to prevent information leakage) and returns a generic 500 page. Check your logs: storage/logs/laravel.log or your configured log driver. Common causes specific to production: missing environment variables (service credentials), database migrations not run, file permission errors on storage/, or PHP extension not installed on the production server that was available locally.