Demystifying HTTP Status Codes & Request Methods
Master standard HTTP verbs and status codes to build predictable, standard-compliant, and self-documenting RESTful APIs.
HTTP Request Methods (Verbs)
HTTP methods represent the semantic intent of requests sent from a client. Using standard methods allows routers and cache servers to optimize queries.
• GET: Retrieve resources. Must be safe and idempotent (multiple identical calls produce the same result without side-effects). • POST: Create a new resource. Non-idempotent. • PUT: Replace an existing resource completely or create it if absent. Idempotent. • PATCH: Perform a partial update to a resource. Non-idempotent. • DELETE: Remove a resource. Idempotent.
To understand how to pass payload inputs using these methods, view the guide How to Pass Data to an API or Server.
HTTP Status Codes Families
The server informs the client of a request's outcome using 3-digit HTTP status codes:
• 1xx Informational: Request received, continuing process. • 2xx Success: The action was successfully received, understood, and accepted. • 3xx Redirection: Further action needs to be taken by the user agent. • 4xx Client Error: The request contains bad syntax or cannot be fulfilled. • 5xx Server Error: The server failed to fulfill an apparently valid request.
A Standard Error Payload Example
{
"status": 404,
"error": "Not Found",
"message": "The requested note could not be found.",
"timestamp": "2026-06-20T00:00:00Z"
}Real-world Status Code Choice
When a user submits form data, if the authentication token is missing, return 401 Unauthorized. If their token is valid but they lack admin access to edit notes, return 403 Forbidden. Keep your errors precise to simplify front-end debugging!