aloapi
aloapi
خواندن ۳ دقیقه·۲ سال پیش

Introduction to Status Codes in http protocol

The status code 200 with the OK message provides the message that the intended task has been successfully completed, and it is important to note that a rating of 2 depending on what HTTP method is used can have a different body. Also, if we do not want the content in the body, we should use the status code 2 with the No Content message. In fact, the status code 204 is usually sent in response to a request from Post, Put and Delete.

When created on the server side of a new reservoir, the status code with the Created message should be considered, but if the relevant task does not occur immediately and the server needs more time to complete it, it should be from code 1 Used with Accepted message. In other words, Code 2 indicates that the ricoost is accepted for processing, but the processing process is not completed due to its length (this code is used in an operation of the so -called Asynchronous so that it is available to the server so that ricoists are available to the server. Receive other tips.)

The status code of 400 with the Bad Request message indicates that there is a problem on the client side that this problem can be due to the wrong syntax, invalid parameters in the Ricoost and so on, while the client does not need to be re -created without fixing the problem. Submit your request.

Status Code 401 with Unauthorized Message indicates that the client has an operation on the reproduction that requires a password, but the client does not have such password and the 403 status code is related to the Forbidden message that the Ricoost is correctly sent. But the server refuses to do it because, for example, the client does not have the permanent access to that spiring, and the difference with code 401 is that in code 401, for example, the problem is resolved, but when the status code is resolved. 403, it means that even if the password is inserted, there are no reports needed to access the refund.

One of the most famous status codes belongs to the 4xx Group of 404 Status Code with Not Found, which shows that API cannot find on the side of the rear server with an address from the client.

The position code 405 is also used with the Method Not Allowed message when the client is trying to use an HTP method that is not permitted on the server side. For example, a so-called Read-Only reserves only support the Get and Head methods, and if we use a method such as PUT or Delete, we will encounter code 405.

The position code 406 with the Not Acceptable message shows that the server is not capable of producing the client format inserted in the Accept. For example, if the client has a format request in Application/XML format but the server only provides format in the Application/JSON format, we will encounter a position code 406.

Sometimes the client provides a series of conditions for the server that only if they are met, the Ricoost must be fulfilled, so that if those conditions are not fulfilled, the status code 412 will be sent with the Precondition Failed message.

for you.....
شاید از این پست‌ها خوشتان بیاید