426 Upgrade Required

HTTP response status code 426 Update Required is a client error that is returned by the server to indicate that it is unwilling to process the request using the current protocol. It does not guarantee that it will do so after the client upgrades to a different protocol, although it may be willing to do so.

Usage

When the 426 Upgrade Required status code is received, the response includes an Upgrade response header field to indicate the required protocol(s).

This message is related to the 101 Switching Protocols message, which is sent in response to the client asking that the server Upgrade the connection.

Note

Search engines like Google will not index a URL with 426 Upgrade Required response status, and consequently, URLs that have been indexed in the past but are now returning this HTTP status code will be removed from the search results.

Example

In the example, the client requests a resource and the server responds with the 426 Upgrade Required error message because it only supports HTTP/2 and HTTP/3. The client upgrades the connection to HTTP/2 and in response, the server sends the 101 Switching Protocols informational response. At this point, the request is processed.

Initial request

GET /tech-news HTTP/1.1
Host: www.example.re

Initial response, will not process request with this protocol

HTTP/1.1 426 Upgrade Required
Upgrade: HTTP/2, HTTP/3
Connection: upgrade
Content-Type: text/html
Content-Length: 154

<html>
  <head>
    <title>Protocol Not Supported</title>
  </head>
  <body>
   <p>This service supports HTTP/2 and HTTP/3 only.</p>
  </body>
</html>

Subsequent request, specifying protocol upgrade

GET /tech-news HTTP/1.1
Host: www.example.re
Connection: upgrade
Upgrade: HTTP/2

Informational response

HTTP/1.1 101 Switching Protocols
Upgrade: HTTP/2
Connection: upgrade

Code references

.NET

HttpStatusCode.UpgradeRequired

Rust

http::StatusCode::UPGRADE_REQUIRED

Rails

:upgrade_required

Go

http.StatusUpgradeRequired

Symfony

Response::HTTP_UPGRADE_REQUIRED

Python3.5+

http.HTTPStatus.UPGRADE_REQUIRED

Apache HttpComponents Core

org.apache.hc.core5.http.HttpStatus.SC_UPGRADE_REQUIRED

Angular

@angular/common/http/HttpStatusCode.UpgradeRequired

Takeaway

The 426 Update Required status code is a client error that is sent by the server when the client is using a protocol that it does not support. Subsequent requests may be processed if the protocol is upgraded.

See also

Last updated: August 2, 2023