HTTP 101 Switching Protocols

The server is switching protocols as requested by the client.

1xx Informational

101

Switching Protocols

Description

The 101 Switching Protocols status code indicates that the server understands and is willing to comply with the client's request, via the Upgrade header field, for a change in the application protocol being used on this connection. The server must generate an Upgrade header field in the response that indicates which protocol(s) will be switched to immediately after the empty line that terminates the 101 response. It is assumed that the server will only agree to switch protocols when it is advantageous to do so, for example switching to a newer version of HTTP or to a real-time synchronous protocol like WebSocket.

When Is It Used?

Most commonly encountered when upgrading an HTTP connection to WebSocket. The client sends an HTTP request with an Upgrade: websocket header, and the server responds with 101 to confirm the protocol switch.

Example Response

HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=

Look Up Any Status Code

Browse all status codes