In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Now the development model of front and back separation is becoming more and more popular. The back end is responsible for developing the corresponding API, and the front end only needs to
Pay attention to the data display and front-end logic of the front-end page.
I personally prefer this development mode of separation between the front and back ends, because it allows more professional people to do more professional things, the back end focuses on API development design, and the front end focuses on data display and page style.
In this way, the front and back ends need to reach some consensus on certain information, such as common HTTP methods, common HTTP status codes, etc.
HTTP Method is relatively simple, and our common habits are as follows:
For general queries, we will use the GET method to create a new record. Use the POST method to update existing data. Use the PUT method to update existing data. Use the PATCH method to delete existing data. Use the Delete method.
Here is a detailed introduction to commonly used HTTP status codes
1xx#
1xx status code is generally an intermediate state of a request, usually a message prompt, request negotiation
100 Continue, request not completed, request should continue
101 Switching Protocol, protocol conversion, encountered when using Web Socket, here is an example, the response will have a request header of Connection: Upgrade, Upgrade will specify the protocol name to be used
2xx#
2xx generally indicates successful request processing
200 OK, request processed successfully
201 Created, request processed successfully and new resource created
202 Accepted, request accepted, processing pending
204 No Content, response content is empty, return a Json(null) in asp.net core will be a result of NoContent
3xx#
3xx generally indicates redirection
301 Moved permanently
302 Found Temporary redirect
307 Temporary Redirect Request
308 Permanent Redirect Request
Differences between these redirects:
301, 302 only support GET request, if it is POST request, GET request will be used after redirection and Body data will be lost 307, 308 Support POST request, when POST redirect will bring the original request body and request a new address, body data will not be lost 302, 307 Temporary redirect 301, 308 Permanent redirect, cache allowed, browser can cache 304 Not Modified, The resource has not been modified. You can directly use the browser's local cache 4xx#
4xx generally indicates client request error
400 BadRequest, error request, generally used to indicate that the request parameters are abnormal, for example, one of the parameters of the request cannot be empty, but the actual request is empty.
401 Unauthorized, the resource requires authorization or login, and the user does not log in or does not provide the Token required for access.
403 Forbidden: The current user does not have permission to access resources, such as users who require the Admin role, but the requesting user does not have this role.
404 Not Found, resource not found.
405 Method Not Allowed, method invocation not allowed, request method not supported by resource, e.g. resource only allows GET request, but actual request uses POST or Delete method
406 Not Acceptable: The client does not support processing of the requested resource. For example, the client wants to get an xml response, but the server only supports JSON responses.
408 Request Timeout
409 Conflict, request resource conflict, often occurs when PUT updates resource information, such as specifying the ETAG of the resource when updating, but when PUT requests, the ETAG of the resource has changed.
410 Gone, request resource is no longer available on origin server
411 Length Required: The request should carry the Content-Length header.
412 Precondition Failed: Some parameters requested do not meet the conditions.
The pre condition given in the request evaluated to false by the server.
413 Payload Too Large: Request parameters are too large, request body is too large, server refuses to process
414 URI Too Long: The requested URI address is too long and the server refuses to process it.
415 Unsupported Media Type, unsupported media type or unsupported encoding, e.g. server only supports JSON requests, but requests are in xml format
5xx#
5xx generally indicates a server-side error
500 Internal Server Error
501 Not Implemented The server does not support functions that need to be processed, such as image compression.
502 Bad Gateway The reverse proxy or gateway could not find a server to process the request.
503 Service unavailable
504 Gateway Timeout
505 HTTP Version Not Supported: The server does not support or refuses to process requests for this HTTP version.
Original text from: https://www.linuxprobe.com/http-status-code.html
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.