Apache2-API
view release on metacpan or search on metacpan
lib/Apache2/API/Status.pm view on Meta::CPAN
<d:prop>
<d:getetag>"5-12"</d:getetag>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
</d:multistatus>
=head2 HTTP_ALREADY_REPORTED (208)
See L<rfc 5842, section 7.1 on WebDAV bindings|https://tools.ietf.org/html/rfc5842#section-7.1>
This is returned predominantly under the WebDav protocol.
=head2 HTTP_IM_USED (226)
See L<rfc 3229 on Delta encoding|https://tools.ietf.org/html/rfc3229>
C<IM> stands for C<Instance Manipulation>.
This is an HTTP protocol extension used to indicate a diff performed and return only a fraction of the resource. This is especially true when the actual resource is large and it would be a waste of bandwidth to return the entire resource. For example...
GET /foo.html HTTP/1.1
Host: bar.example.net
If-None-Match: "123xyz"
A-IM: vcdiff, diffe, gzip
Then, the server would reply something like:
HTTP/1.1 226 IM Used
ETag: "489uhw"
IM: vcdiff
Date: Tue, 25 Nov 1997 18:30:05 GMT
Cache-Control: no-store, im, max-age=30
See also the L<HTTP range request|https://tools.ietf.org/html/rfc7233> triggering a C<206 Partial Content> response.
=head2 HTTP_MULTIPLE_CHOICES (300)
See L<rfc 7231, section 6.4.1|https://tools.ietf.org/html/rfc7231#section-6.4.1> and L<rfc 5988|https://tools.ietf.org/html/rfc5988> for the C<Link> header.
See L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/300>
This is returned when there is a redirection with multiple choices possible. For example:
HTTP/1.1 300 Multiple Choices
Server: Apache/2.4
Access-Control-Allow-Headers: Content-Type,User-Agent
Access-Control-Allow-Origin: *
Link: </foo> rel="alternate"
Link: </bar> rel="alternate"
Content-Type: text/html
Location: /foo
However, because there is no standard way to have the user choose, this response code is never used.
=head2 HTTP_MOVED_PERMANENTLY (301)
See L<rfc 7231, section 6.4.2|https://tools.ietf.org/html/rfc7231#section-6.4.2>
This is returned to indicate the target resource can now be found at a different location and all pointers should be updated accordingly. For example:
HTTP/1.1 301 Moved Permanently
Server: Apache/2.4
Content-Type: text/html; charset=utf-8
Date: Mon, 18 Apr 2022 17:33:08 GMT
Location: https://example.org/some/where/else.html
Keep-Alive: timeout=15, max=98
Accept-Ranges: bytes
Via: Moz-Cache-zlb05
Connection: Keep-Alive
Content-Length: 212
<!DOCTYPE html>
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://example.org/some/where/else.html">here</a>.</p>
</body></html>
See also C<308 Permanent Redirect>
=head2 HTTP_MOVED_TEMPORARILY (302)
See L<rfc 7231, section 6.4.3|https://tools.ietf.org/html/rfc7231#section-6.4.3>
This is returned to indicate the resource was found, but somewhere else. This is to be understood as a temporary change.
The de facto standard, divergent from the original intent, is to point the client to a new location after a C<POST> request was performed. This is why the status code C<307> was created.
See also C<307 Temporary Redirect>, which more formally tells the client to reformulate their request to the new location.
See also C<303 See Other> for a formal implementation of aforementioned de facto standard, i.e. C<GET> new location after C<POST> request.
=head2 HTTP_SEE_OTHER (303)
See L<rfc 7231, section 6.4.4|https://tools.ietf.org/html/rfc7231#section-6.4.4>
This is returned to indicate the result of processing the request can be found at another location. For example, after a C<POST> request, such as:
HTTP/1.1 303 See Other
Server: Apache/2.4
Location: /worked/well
It is considered better to redirect once request has been processed rather than returning the result immediately in the response body, because in the former case, this wil register a new entry in the client history whereas with the former, this would...
=head2 HTTP_NOT_MODIFIED (304)
See L<rfc 7232, section 4.1 on Conditional Request|https://tools.ietf.org/html/rfc7232#section-4.1>
This is returned in response to a conditional C<GET> or C<POST> request with headers such as:
=over 4
=item L<If-Match|https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match>
=item L<If-None-Match|https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match>
=item L<If-Modified-Since|https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since>
( run in 1.234 second using v1.01-cache-2.11-cpan-524268b4103 )