When you see this status
- Client sends HTTP/1.0 request to server requiring HTTP/1.1
- Client uses deprecated protocol version for the endpoint
- Server mandates TLS upgrade but client doesn't support it
Common causes
- Client uses outdated HTTP protocol version
- Server requires TLS but client connects via plain HTTP
- API version mismatch between client and server
How to debug it
- Verify client's HTTP protocol version in request headers
- Check server's minimum protocol requirements
- Inspect response 'Upgrade' header for required protocol
- Update client to use supported protocol version
Return this code in your framework
Express (Node.js)
res.status(426).set('Upgrade', 'h2').send('Upgrade to HTTP/2 required');
FastAPI (Python)
@app.get('/')
def root():
return Response(status_code=426, headers={'Upgrade': 'h2'})
NestJS
@Get()
root(): string {
return 'Upgrade Required';
}
@HttpCode(426)
@Header('Upgrade', 'h2')
@Get('upgrade')
upgrade() {}
Go (net/http)
w.WriteHeader(http.StatusUpgradeRequired)
w.Header().Set("Upgrade", "h2")
About HTTP 426
HTTP status code 426 Upgrade Required is part of the
4xx Client Error family. Server refuses to process request without a required protocol upgrade. Understanding it is essential for
backend engineers, API designers, and anyone debugging integrations between services.
The Qaynaq Labs HTTP Status Code Explainer covers all standard codes with practical guidance:
what triggers them, how to debug them in production, and exactly how to return them from common
frameworks. Each code page is hand-curated and verified.