Web server response code 204 instead of 200

Tell me please. why can the response code from the web server return 204 instead of 200? for example, the browser requests a page, and the page loads javascript, which contains a redirect. but it turns out that when the browser follows the link of this redirect, the server does not give it a page with the code 200, but an empty response with the code 204. why can this happen? Sorry, I couldn't explain the situation clearly. moreover, javascript is loaded on the page from another application (from another server). cross-domain.

Author: leol, 2014-02-20

1 answers

HTTP/1.0 status code 204 means "no response" and is returned when the server has received a request, but it has nothing to report in response, and the client must remain on the previous page (not change the page view). It is used mainly to accept data from a script, while at the same time not changing the document.

No Response 204

Server has received the request but there is no information to send back, and the client should stay in the same document view. This is mainly to allow input for scripts without changing the document at the same time.

Upd. more up-to-date HTTP/1.1 RFC 2616 writes about the same, read more:

10.2.5 204 No Content

The server has fulfilled the request but does not need to return an entity-body, and might want to return updated metainformation. The
response MAY include new or updated metainformation in the form of
entity-headers, which if present SHOULD be associated with the
requested variant.

If the client is a user agent, it SHOULD NOT change its document view
from that which caused the request to be sent. This response is primarily intended to allow input for actions to take place without causing a change to the user agent's active document view, although any new or updated metainformation SHOULD be applied to the document currently in the user agent's active view.

The 204 response MUST NOT include a message-body, and thus is always
terminated by the first empty line after the header fields.

 1
Author: Sergiks, 2014-02-20 11:04:40