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/426Frequently Asked Questions
What does HTTP Status 426 mean?
Why am I getting a 426 status code?
How do I fix a 426 Upgrade Required error?
How can I test how my app handles a 426 response?
Other 4xx status codes
Browse the full HTTP status codes directory or troubleshoot terminal errors in the Error Fix Encyclopedia.