Posted on

HTTP Status Codes Explained for Beginners

Monochrome technical illustration for HTTP Status Codes Explained

An HTTP status code is the server’s compact result for a request. Read it with the response headers and JSON body to decide what succeeded and what to inspect next.

The useful status-code groups

GroupMeaning
2xxSuccessful request
3xxRedirect or further action
4xxRequest or permission problem
5xxServer-side failure

The codes you will meet first

CodeMeaningInspect next
200Read or update succeededJSON body and expected fields
201A POST created a resourceSave the returned UUID
204Action succeeded without a bodyDo not try to parse JSON
301/308RedirectCheck the URL and trailing slash
400Invalid inputRead field and validation details
401Missing or invalid credentialsCheck token presence and type
403Authenticated but not permittedCheck visibility and scopes
404Route or resource not foundCopy exact slugs and UUID
409ConflictCheck duplicate or current state
429Rate limitedBack off; do not retry immediately
500/503Server unavailable or failedRecord request ID and retry safely

Inspect status and body together

curl -i "https://meowmeowscratch.com/api/v1/YOUR_USERNAME/weather-station/readings/" \
  -H "Authorization: Bearer $MEOW_APP_API_KEY"Code language: JavaScript (javascript)

The -i option prints the status line and headers before the JSON. A useful error includes a stable code, message, details and request ID. Never log the bearer token while troubleshooting.

A practical diagnostic flow

  1. Confirm the scheme, host, API version, username, app slug and endpoint slug.
  2. Confirm the method matches the intended operation.
  3. Check the trailing slash on management routes.
  4. Check the credential type and required scope without exposing its value.
  5. Read the JSON error details before changing the payload.
  6. For 429 or transient 5xx responses, retry with a bounded exponential backoff.
  7. For repeated 5xx responses, record the request ID, time and route for support.

Next step

For a deeper credential and retry flow, read REST API Authentication and Common Errors. To practice each method, return to HTTP Methods Explained.