How the Web Works
HTTP Verbs & Status Codes
Learn the methods browsers and APIs use to talk to servers, and how to read status codes.
Learning objectives
- Recognize the common HTTP methods
- Interpret status codes by class
- Understand safe versus non-safe methods
Common HTTP methods
HTTP defines a set of verbs that describe the intention of a request:
GET- retrieve a resource, never changes server statePOST- submit data, such as a contact formPUTandPATCH- update a resourceDELETE- remove a resource
Using the correct verb keeps applications predictable and secure. For example, actions that change data should never be triggered by a GET request, because links and pre-fetchers can repeat them unintentionally.
Reading status codes
- 2xx - Success:
200 OK,201 Created - 3xx - Redirection:
301 Moved Permanently,304 Not Modified - 4xx - Client error:
404 Not Found,403 Forbidden - 5xx - Server error:
500 Internal Server Error,503 Service Unavailable
Why this matters
When we audit a client platform, the first thing we look at is its response patterns. A flood of 404 responses or a high rate of 500 errors tells a clear story about code quality, configuration, and server health.
Key takeaways
- Use GET for reading and POST for writing.
- Status codes are grouped by class: 2xx, 3xx, 4xx, 5xx.
- Diagnosis starts with reading status codes correctly.