HTTP 426 Upgrade Required

The server refuses to serve this request over the current protocol and names the one to switch to in the Upgrade header.

Defined in RFC 9110 §15.5.22 — 426 Upgrade Required · MDN reference

Where you meet HTTP 426 in production

WebSocket endpoints receiving a normal HTTP request, servers that require a newer HTTP version, and services that refuse plaintext and require TLS.

Why you would test it

Useful for checking that clients pinned to an old protocol fail clearly, and that a WebSocket endpoint answers plain HTTP with something more useful than 400.

What your client should do about a 426

Switch to the protocol in the Upgrade header and try again. For a WebSocket endpoint that means connecting with a WebSocket client, not fetch().

426 versus the codes it gets confused with

Endpoints that return 426

1 endpoint in this playground answers with 426. Every one is free, needs no signup, and can be called from the browser or with curl.

Questions about HTTP 426

Why does my WebSocket URL return 426?
You requested it with plain HTTP. Open it with a WebSocket client so the Upgrade handshake happens.
Does 426 include the protocol to use?
Yes — the Upgrade response header lists it.

Other client error codes

All HTTP status codes · All 39 mock REST APIs · Getting started guide

Last updated