HTTP 101 — Switching Protocols
1xx Informational
What it means
The server is switching to the protocol the client asked for in the Upgrade header — almost always a WebSocket handshake.
What to do about it
Nothing to fix. If you expected a WebSocket connection and do not see a 101, check that a proxy in front of the app forwards the Upgrade and Connection headers.
Where it sits
101 belongs to the 1xx family: The request was received and the process is continuing. These are rarely seen by application code.
HTTP/1.1 101 Switching Protocols
Checking it yourself
# see the status code and headers only
curl -sI https://example.com/path
# follow redirects and print each hop
curl -sIL -o /dev/null -w "%{http_code} %{url_effective}\n" https://example.com/path
# JavaScript
const r = await fetch(url);
console.log(r.status, r.statusText);
How this code behaves
| Cacheable by default | No — caches must not store this response unless explicit cache headers permit it. |
| Safe to retry | Not applicable. |
| Effect on search indexing | No direct effect. |
Returning 101 correctly
# nginx
return 101;
# Express
res.status(101).json({ error: 'Switching Protocols' });
# Go
w.WriteHeader(101)
# Python (Flask)
return jsonify(error='Switching Protocols'), 101;
Frequently asked questions
What does HTTP 101 mean?
The server is switching to the protocol the client asked for in the Upgrade header — almost always a WebSocket handshake.
How do I fix a 101 error?
Nothing to fix. If you expected a WebSocket connection and do not see a 101, check that a proxy in front of the app forwards the Upgrade and Connection headers.
Is 101 a client or server problem?
Neither — it indicates success or progress.