Skip to main content
HTTP/4xx (Client Error)

426 Upgrade Required

The server refuses to perform the request using the current protocol but might after the client upgrades.

❓ Why does this happen?

Server requires TLS or a newer protocol (for example HTTP/2 or WebSocket) indicated in the Upgrade header.

✅ How to fix it

Switch to HTTPS or the protocol listed in the Upgrade response header.

Return or handle 426 in your stack

// app/api/resource/route.ts
export function GET() {
  return Response.json(
    { error: "Upgrade Required", status: 426 },
    {
      status: 426,
      headers: { "Upgrade": "HTTP/2.0", "Connection": "Upgrade" }
    }
  );
}

Live 426 mock endpoint

Point your app, tests, or retry logic at this free public URL to reproduce a real 426 response (CORS enabled, optional ?delay=ms up to 5000).

https://castov.com/api/mock/426

Frequently Asked Questions

What does HTTP Status 426 mean?
The server refuses to perform the request using the current protocol but might after the client upgrades.
Why am I getting a 426 status code?
Server requires TLS or a newer protocol (for example HTTP/2 or WebSocket) indicated in the Upgrade header.
How do I fix a 426 Upgrade Required error?
Switch to HTTPS or the protocol listed in the Upgrade response header.
How can I test how my app handles a 426 response?
Send a request to https://castov.com/api/mock/426 — it returns a real 426 Upgrade Required response with CORS enabled. Add ?delay=2000 to simulate a slow server.

Other 4xx status codes

Browse the full HTTP status codes directory or troubleshoot terminal errors in the Error Fix Encyclopedia.