In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains the "feign client HTTP status code for 204 when the response body is ignored how to solve", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "feign client HTTP status code 204 when the response body is ignored how to solve" it!
The responder is ignored when the feign client HTTP status code is 204
A problem was encountered while using spring-cloud Greenwich.SR3. Because the server HTTP status code is designed in rest style, the http status code for operations such as update returns 204.
HttpStatus.NO_CONTENT (204, "No Content") *
However, some interfaces still want to return the modified data. So the return body actually has content.
Return ResponseEntity (data, HttpStatus.NO_CONTENT)
As a result, the client cannot receive the data value, so it can be received by changing it to a normal 200 return.
Return ResponseEntity (data, HttpStatus.OK)
It is speculated that feign has processed the status code 204. after all, 204 means that the response body is empty.
HTTP status Code and its meaning
When developing Web projects, deployment failures often occur because of environment building and configuration, and the rare http status of 502is also caused by the lack of some libraries in php-admin when setting up this blog. Usually do not pay much attention to these status code information, but also do not understand the internal causes of this state, every time it appears to look for. In order to sort out and memo in detail, organize a copy of the http status code and its meaning analysis.
The following information is referenced from: RFC 2616
There are five main types of Http status codes:
1XX: information status code
100 Continue: the client should continue to send requests. This temporary response is used to inform the client that some of its requests have been received by the server and have not yet been rejected. The client should continue to send the rest of the request or ignore the response if the request has been completed. The server must send a final response to the client after the request
Switching Protocols: the server has understood the client's request and will inform the client through the Upgrade header that a different protocol is used to complete the request. After sending the last blank line of the response, the server will switch to the protocols defined in the Upgrade header.
2XX: success status code
200 OK: the request is successful, and the desired response header or data body will be returned with this response
Created: indicates that the server created a new document in the response to the request; its URL should be given in the location header information.
202 Accepted: tells the client that the request is being executed, but it is not finished yet.
203 Non-Authoritative Information: indicates that the document was returned normally, but some response headers may be incorrect because you are using a copy of the document. (HTTP 1.1 new).
204 No Content: there is no new document, the browser should continue to display the original document. This status code is useful if the user refreshes the page regularly and Servlet can determine that the user document is new enough.
Reset Content: there is no new content, but the browser should reset what it displays. Used to force browsers to clear form input (HTTP 1.1 new).
206Partial Content: the customer sent a GET request with a Range header, and the server completed it (HTTP 1.1 new).
3XX: redirect
300 Multiple Choices: the document requested by the customer can be found in multiple locations, which are already listed in the returned document. If the server wants to make a priority, it should be indicated in the Location response header.
301 Moved Permanently: the document requested by the customer is elsewhere, the new URL is given in the Location header, and the browser should automatically access the new URL.
302 Found: similar to 301, but the new URL should be seen as a temporary replacement, not permanent. Notice that the corresponding status information in HTTP1.0 is "Moved Temporatily". When this status code appears, the browser can automatically access the new URL, so it is a very useful status code. Note that this status code is sometimes used interchangeably with 301. For example, if the browser mistakenly requests http://host/~user (missing the trailing slash), some servers return 301 and others return 302. Strictly speaking, we can only assume that the browser will redirect automatically only if the original request is GET. See 307.
303 See Other: similar to 301 See Other 302, except that if the original request is the redirect target document specified by the POST,Location header, it should be extracted through GET (HTTP 1.1 new).
Not Modified: the client has buffered documents and issues a conditional request (typically providing an If-Modified-Since header to indicate that the customer only wants to update the document on a specified date). The server tells the customer that the original buffered document can continue to be used.
Use Proxy: the documents requested by the customer should be extracted through the proxy server specified in the Location header (HTTP 1.1 new).
306 (unused): not used
307 Temporary Redirect: same as 302 (Found). Many browsers will mistakenly redirect in response to a 302 reply, even if the original request is POST, even if it can only be redirected when the reply to the POST request is 303. For this reason, HTTP 1.1has added 307s to make it clear that there are several status codes: when a 303reply occurs, the browser can follow the redirected GET and POST requests; if it is a 307reply, the browser can only follow the redirection of the GET request. (HTTP 1.1 New)
4XX: client error
400 Bad Request: syntax error occurred in the request
401 Unauthorized: the customer attempts to access a password-protected page without authorization. A WWW-Authenticate header is included in the reply, and the browser displays the user name / password dialog box, and then issues the request again after filling in the appropriate Authorization header.
402 Payment Required: not used.
403 Forbidden: resource is not available. The server understands the customer's request but refuses to process it. It is usually caused by permission settings for files or directories on the server.
404 Not Found: the resource at the specified location could not be found. This is also a common response.
Method Not Allowed: request methods (GET, POST, HEAD, DELETE, PUT, TRACE, etc.) are not applicable to the specified resource. (HTTP 1.1 New)
Not Acceptable: the specified resource has been found, but its MIME type is not compatible with the one specified by the customer in the Accpet header (HTTP 1.1 new).
407 Proxy Authentication Required: similar to 401, indicating that the customer must first be authorized by the proxy server. (HTTP 1.1 New)
Request Timeout: no request has been made by the customer during the waiting time for the server license. The customer can repeat the same request later. (HTTP 1.1 New)
409 Conflict: usually related to PUT requests. The request cannot succeed because the request conflicts with the current state of the resource. (HTTP 1.1 New)
410 Gone: the requested document is no longer available, and the server doesn't know which address to redirect to. It differs from 404 in that returning 407 indicates that the document has permanently left the specified location, while 404 indicates that the document is not available for unknown reasons. (HTTP 1.1 New)
411 Length Required: the server cannot process the request unless the customer sends a Content-Length header. (HTTP 1.1 New)
412 Precondition Failed: some of the prerequisites specified in the request header failed (HTTP 1.1 new).
413 Request Entity Too Large: the size of the target document is larger than the server is currently willing to process. If the server thinks it can process the request later, it should provide a Retry-After header (HTTP 1.1 new).
414 Request-URI Too Long:URI is too long (HTTP 1.1 new).
415 Unsupported Media Type: the server does not know what to do with the format type of the attachment that comes with the request. (HTTP 1.1 New)
416 Requested Range Not Satisfiable: the server cannot satisfy the Range header specified by the customer in the request. (HTTP 1.1 New)
417 Expectation Failed: if the server gets an Expect request header with a value of 100-continue, this means that the client is asking if an attachment can be sent in a later request. In this case, the server also uses this state (417) to tell the browser server not to receive the attachment or 100 (SC_CONTINUE) to tell the client that it can continue to send the attachment. (HTTP 1.1 New)
5XX: server error
500 Internal Server Error: the server encountered an unexpected situation and was unable to complete the customer's request.
501 Not Implemented: the server does not support the functionality required to implement the request. For example, the customer makes a PUT request that the server does not support.
502 Bad Gateway: when the server acts as a gateway or proxy, it accesses the next server to complete the request, but the server returns an illegal reply.
503 Service Unavailable: the server failed to answer due to maintenance or overload. For example, Servlet might return 503 if the database connection pool is full. The server can provide a Retry-After header when it returns 503.
504 Gateway Timeout: used by a server acting as a proxy or gateway to indicate that an answer cannot be obtained from a remote server in a timely manner. (HTTP 1.1 New)
505 HTTP Version Not Supported: the server does not support the HTTP version specified in the request. (HTTP 1.1 New)
Thank you for your reading, the above is the "feign client HTTP status code 204 when the response body is ignored how to solve" the content, after the study of this article, I believe you on the feign client HTTP status code 204 when the response body is ignored how to solve this problem has a more profound experience, the specific use of the need for you to practice verification. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.