Beginner LevelREST APIs & Web Services
What are standard HTTP Status Codes (200, 201, 204, 400, 401, 403, 404, 409, 429, 500, 503)?
❓ Interview Prompt: Explain the core HTTP status code categories and the exact difference between 401 Unauthorized vs 403 Forbidden.
HTTP Status Codes inform the client about the result of their HTTP request:
Status Code Categories:
•
'2xx' Success: '200 OK', '201 Created' (resource created), '204 No Content' (successful deletion/update with empty body).
•
'3xx' Redirection: '301 Moved Permanently', '304 Not Modified' (browser cache validation).
•
'4xx' Client Errors:
•
'400 Bad Request': Malformed JSON or failed schema validation.
•
'401 Unauthorized': Authentication missing or invalid token (unauthenticated!).
•
'403 Forbidden': User authenticated successfully, but lacks permissions (unauthorized!).
•
'404 Not Found': Resource URI does not exist.
•
'409 Conflict': Database unique constraint violation (e.g. duplicate email).
•
'429 Too Many Requests': Rate limit exceeded.
•
'5xx' Server Errors: '500 Internal Server Error', '503 Service Unavailable'.
Code Implementation Example
json
{
"status": 403,
"error": "Forbidden",
"message": "You do not have permission to delete resource 'user_123'",
"timestamp": "2026-07-28T10:00:00Z"
}💡Standard RFC error response with 403 Forbidden status.
🎯 Interview Key Takeaway
Use 401 for unauthenticated requests (missing/bad token) and 403 for authenticated requests lacking permission.
#Status Codes#REST API#HTTP#Beginner
Back to all REST APIs & Web Services Questions→