300 Multiple Choices
When more than one representation exists for a requested resource, the server responds with 300 Multiple Choices. The client is responsible for selecting the option best fitting its requirements.
The response is cacheable by default. To override this behavior, include appropriate Cache-Control headers.
Usage
When the 300 Multiple Choices status code is received, the message body contents differ depending on the request method. A HEAD request includes no message body. For other methods, the body contains a list from which the client selects the most appropriate response.
For non-HEAD responses, the body contains
the list of available choices. The Link
header with rel="alternate" is also used to
identify each option. If a default response exists
or the server has a preferred choice, the
Location header identifies this
preference.
Example
The client requests a resource and the server offers multiple options. The headers include paths to each resource. Because this follows a GET request, the body provides a clickable list of options.
Request
GET /tech-news HTTP/1.1
Host: www.example.re
Response
HTTP/1.1 300 Multiple Choices
Link: </leading/news.html>; rel="alternate"
Link: </bleeding/news.html>; rel="alternate"
Location: /leading/news.html
Content-Type: text/html
Content-Length: 154
<h2>Choose from one of the following</h2>
<ul>
<li><a href=/leading/news.html>Leading edge</a>
<li><a href=/bleeding/news.html>Bleeding edge</a>
</ul>
Browser behavior
Browsers render a 300 response body like ordinary content, presenting the list of choices as a regular page. Automatic redirection is reserved for the 301, 302, 303, 307, and 308 status codes, so the Location header in a 300 response serves as a hint rather than a navigation instruction. In practice, 300 is rarely encountered because proactive Content-Negotiation through the Accept and Accept-Language request headers handles format selection transparently.
Code references
.NET
HttpStatusCode.MultipleChoices
Rust
http::StatusCode::MULTIPLE_CHOICES
Rails
:multiple_choices
Go
http.StatusMultipleChoices
Symfony
Response::HTTP_MULTIPLE_CHOICES
Python3.5+
http.HTTPStatus.MULTIPLE_CHOICES
Java
java.net.HttpURLConnection.HTTP_MULT_CHOICE
Apache HttpComponents Core
org.apache.hc.core5.http.HttpStatus.SC_MULTIPLE_CHOICES
Angular
@angular/common/http/HttpStatusCode.MultipleChoices