What 426 Upgrade Required means
426 Upgrade Required tells the client that this resource requires a protocol the current request did not use. Most commonly seen when an HTTP endpoint requires HTTPS, or when an HTTP/1.1 endpoint requires HTTP/2 or WebSocket. The response must include an Upgrade header listing acceptable protocols.
When servers should return it: Return 426 when a resource requires a specific protocol not used by the current request.
Common causes
- HTTP request to an HTTPS-only endpoint
- HTTP/1.1 request to an HTTP/2-required endpoint
- WebSocket required but client did not upgrade
How to fix 426 Upgrade Required
- Use HTTPS instead of HTTP
- Upgrade HTTP client to support HTTP/2
- For WebSocket, send Upgrade and Connection headers
Example response
HTTP/1.1 426
upgrade: TLS/1.2, HTTP/2
connection: Upgrade
content-type: text/plain
This resource requires HTTPS
More references
For a one-page reference of all HTTP status codes, see the HTTP cheat sheet. For testing API responses, try the API Tester tool. For inspecting responses on the command line, the curl cheat sheet covers the most common flags.