Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. HTTP
  3. Reference
  4. HTTP response status codes
  5. 406 Not Acceptable

406 Not Acceptable

The HTTP406 Not Acceptableclient error response status code indicates that the server could not produce a response matching the list of acceptable values defined in the request'sproactive content negotiation headers and that the server was unwilling to supply a default representation.

Proactive content negotiation headers include:

A server may return responses that differ from the request's accept headers.In such cases, a200 response with a default resource that doesn't match the client's list of acceptable content negotiation values may be preferable to sending a 406 response.

If a server returns a 406, the body of the message should contain the list of available representations for the resource, allowing the user to choose, although no standard way for this is defined.

Status

http
406 Not Acceptable

Examples

Content type not available

The following request assumes thatwww.example.com/docs/doc1 supports sending a document back asapplication/rtf:

http
GET /docs/doc1 HTTP/1.1Host: example.comAccept: application/rtf;

In this example, the server implementation does not fallback to a default content type liketext/html orapplication/json, but returns a 406 instead:

http
HTTP/1.1 406 Not AcceptableDate: Wed, 26 Jun 2024 12:00:00 GMTServer: Apache/2.4.1 (Unix)Content-Type: application/json{  "code": "UnsupportedType",  "message": "Only 'text/html' or 'application/json' content types supported.",}

Specifications

Specification
HTTP Semantics
# status.406

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp