reading-notes

View the Project on GitHub Abu-laban/reading-notes

Status Codes Based On REST Methods


202 Accepted - Often used for asynchronous processing. This code tells the client that the request was valid, but its processing will finish sometime in the future. The response body should include an URL to the finished resource with some information about when it will be available, or an URL to some monitoring endpoint that tells the client when the resource is available.


What is a status code 308?

308 Permanent Redirect - This tells the client to use another URL to access the resource and not use the current URL anymore. It’s helpful when we have multiple endpoints for one resource, but don’t want to implement reading from all of them.


204 No Content - A proper code for updates that don’t return data to the client, for example when just saving a currently edited document.


410 Gone - This is like 404 but we know that the resource existed in the past, but it got deleted or somehow moved, and we don’t know where.


403 Forbidden - The client has authorized or doesn’t need to authorize itself, but still has no permissions to access the resource.