REST API Status Codes
REST API Status Codes
Hello everyone, these days I have to use REST API for user operations etc. in one of my projects and while developing an application on the backend using a REST API, there are some rules that we must follow.
It is especially important to follow these rules to inform the client about events on the server side. Especially if you want your code to be understood by everyone, I can say that complying with internationally established standards is inevitable. Come on, let's take a look at which values the values ("status") returned on the server side mean when developing an application with REST API.
Methods and the Status Codes They Receive
Status Codes and Their Meanings
Let's take a general look at the status codes.
- 1xx - Informational Request.
- 2xx - Request successful.
- 3xx - Request redirected. Rarely used.
- 4xx - Client Errors (usually codes like 401, 404).
- 5xx - Server error (usually 500).
Now that we've taken a general look at which codes that start with which digits represent, let's examine it a little more code-based.


Yorum Gönder