HTML: Markup language
CSS: Styling language
JavaScript: Scripting language
Web APIs: Programming interfaces
All web technology
Learn web development
Discover our tools
Get to know MDN better
The HTTP 101 Switching Protocols informational response status code indicates the protocol that a server has switched to. The protocol is specified in the Upgrade request header received from a client.
101 Switching Protocols
Upgrade
The server includes an Upgrade header in this response to indicate the protocol it has agreed to switch to. The process is described in detail in the Protocol upgrade mechanism guide.
The following example shows how switching protocols might be used with WebSockets. A client sends a GET HTTP request with an Upgrade header which must also be listed in the Connection header. The server agrees to switch protocols, returning a 101 response meaning the connection has switched from HTTP to WebSocket. At this point, the client and server can now start exchanging WebSocket data. Information about how to set Sec-WebSocket-* headers for handshake negotiation can be found in WebSocket-specific headers.
GET
Connection
Sec-WebSocket-*
GET /notifications HTTP/1.1 Host: example.com Upgrade: websocket Connection: Upgrade
HTTP/1.1 101 Switching Protocols Upgrade: websocket Connection: Upgrade
426 Upgrade Required