Skip to main content
HTTP/1xx (Informational)

101 Switching Protocols

The requester has asked the server to switch protocols and the server has agreed to do so.

❓ Why does this happen?

Typically sent during the WebSocket handshake when upgrading an HTTP/1.1 connection to the ws:// or wss:// protocol.

✅ How to fix it

Ensure WebSocket client and server connection handshakes include valid Upgrade and Connection headers.

Return or handle 101 in your stack

// Route Handlers cannot return 1xx responses: the Response constructor
// only accepts status codes 200-599. 101 Switching Protocols is emitted by the server/CDN layer.

Live 101 mock endpoint

101 is an interim 1xx response. Browsers and the Fetch API never expose 1xx codes as a final response, so it cannot be mocked directly. Try /api/mock/200 instead.

Frequently Asked Questions

What does HTTP Status 101 mean?
The requester has asked the server to switch protocols and the server has agreed to do so.
Why am I getting a 101 status code?
Typically sent during the WebSocket handshake when upgrading an HTTP/1.1 connection to the ws:// or wss:// protocol.
How do I fix a 101 Switching Protocols error?
Ensure WebSocket client and server connection handshakes include valid Upgrade and Connection headers.

Other 1xx status codes

Browse the full HTTP status codes directory or troubleshoot terminal errors in the Error Fix Encyclopedia.