developerasun / myCodeBox-web

Open source code box for web developers.
Apache License 2.0
5 stars 0 forks source link

[RESEARCH] Web/Status code #215

Open developerasun opened 2 years ago

developerasun commented 2 years ago

topic :

read this

HTTP response status codes indicate whether a specific HTTP request has been successfully completed. Responses are grouped in five classes:

  1. Informational responses (100–199)
  2. Successful responses (200–299)
  3. Redirection messages (300–399)
  4. Client error responses (400–499)
  5. Server error responses (500–599)

reference

developerasun commented 2 years ago

Successful responses

200 OK The request succeeded. The result meaning of "success" depends on the HTTP method:

  1. GET: The resource has been fetched and transmitted in the message body.
  2. HEAD: The representation headers are included in the response without any message body.
  3. PUT or POST: The resource describing the result of the action is transmitted in the message body.
  4. TRACE: The message body contains the request message as received by the server.

201 Created The request succeeded, and a new resource was created as a result. This is typically the response sent after POST requests, or some PUT requests.

Client error responses

400 Bad Request The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).

401 Unauthorized Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response.

402 Payment Required This response code is reserved for future use. The initial aim for creating this code was using it for digital payment systems, however this status code is used very rarely and no standard convention exists.

403 Forbidden The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server.

404 Not Found The server can not find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web.

developerasun commented 2 years ago

Server error responses

500 Internal Server Error The server has encountered a situation it does not know how to handle.

501 Not Implemented The request method is not supported by the server and cannot be handled. The only methods that servers are required to support (and therefore that must not return this code) are GET and HEAD.

502 Bad Gateway This error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response.