| Status code | 101 |
|---|---|
| Status text | Switching Protocols |
| Category | 1xx Informational |
| Response has body | No |
| Specification | RFC 9110 |
What does 101 Switching Protocols mean?
The server is switching to a different protocol as requested by the client's Upgrade header. It belongs to the 1xx Informational class, which means the request was received and the process is continuing. These are interim responses you rarely handle directly.
When do APIs return 101?
Almost always a WebSocket handshake upgrading an HTTP connection.
How to fix a 101 Switching Protocols
Expected during WebSocket setup. Note that a plain HTTP tester cannot continue the conversation after the upgrade — you need a WebSocket client.
Reproduce a 101 response
The fastest way to understand a status code is to trigger one and read the full response. Open the
API tester and send a request to https://httpbin.org/status/101 — you will
see the 101 status along with every response header the server sent. Comparing those headers against
a working request is often what reveals the cause.
When you are debugging a real endpoint, check the response headers as carefully as the body, and confirm you are using the right HTTP method for the operation.
Related 1xx status codes
100 Continue
The server received the request headers and the client should proceed to send the request body.
102 Processing
The server has accepted the request but has not yet completed it.
103 Early Hints
The server is sending preliminary headers, typically Link headers for preloading, before the final response.