tezvyn:

HTTP Status Codes: The Server's Signal

Source: developer.mozilla.orgbeginner

HTTP status codes are the server's signal for a request's outcome: success, client error, or server error. You see them when fetching data (200 OK), hitting a bad link (404), or when a server fails (500). Footgun: Don't just check for 'not 200'.

HTTP status codes are the server's standardized reply to a request, signaling the outcome. They're a universal language for "got it, here's your data," "you asked for something wrong," or "something broke on my end." You handle them when fetching API data (200 OK), creating a user (201 Created), or debugging a server crash (500). The footgun is treating anything but 200 OK as a generic failure. A 202 Accepted is a success that means work is queued, not finished, and a 403 Forbidden is very different from a 404 Not Found.

Read the original → developer.mozilla.org

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

HTTP Status Codes: The Server's Signal · Tezvyn