HTTPQUERY
中文

300 Multiple Choices

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: example.com

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: 164

<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

Most browsers do not present a selection interface when receiving a 300 response. When a Location header is present, browsers typically follow the preferred option automatically, similar to a 302 redirect. Without a Location header, the browser renders the response body, which contains the list of available choices. In practice, 300 is rarely encountered because Content-Negotiation 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