Qaynaq LABS · TOOLS

HTTP · 1xx Informational

101 Switching Protocols

Server agrees to switch protocols per client Upgrade header request.

When you see this status

  • Client sends Upgrade header with protocol change request
  • Server supports and accepts the protocol upgrade
  • WebSocket handshake succeeds

Common causes

  • Client requests protocol upgrade via Upgrade header
  • Server supports the requested protocol
  • WebSocket handshake in progress

How to debug it

  1. Verify client sent valid Upgrade header
  2. Check server supports requested protocol
  3. Inspect network traffic for protocol negotiation

Return this code in your framework

Express (Node.js)
res.status(101).send('');
FastAPI (Python)
@app.get('/')
def upgrade():
    return Response(status_code=101)
NestJS
@Get()
upgrade() {
  return new HttpStatusCode(101);
}
Go (net/http)
w.WriteHeader(http.StatusSwitchingProtocols)

About HTTP 101

HTTP status code 101 Switching Protocols is part of the 1xx Informational family. Server agrees to switch protocols per client Upgrade header request. 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.

Frequently asked

Can I return 101 for any protocol upgrade?

No. Server must explicitly support the requested protocol. Common use is WebSocket upgrades.

Does 101 require a response body?

No. The response may be empty. Headers must indicate the new protocol.

Is 101 safe to retry?

No. 101 is not idempotent. Retrying may cause duplicate protocol switches.