101

HTTP 101 Switching Protocols

1xx Informational

  1. Home
  2. > HTTP Status Codes >
  3. > 1xx >
  4. 101
1xx Informational RFC 7231, Section 6.2.2

What is HTTP 101 Switching Protocols?

The 101 (Switching Protocols) status code indicates the server understands and is willing to comply with the client's request to switch protocols. The server will include an Upgrade header to indicate which protocol it is switching to. This is the cornerstone of WebSocket connections — when a client sends an Upgrade: websocket header, the server responds with 101 to confirm the protocol switch from HTTP to WebSocket, enabling real-time bidirectional communication.

Common Use Cases

  • WebSocket upgrade handshake
  • HTTP/2 protocol upgrade
  • Adding real-time communication to web applications
Help2Code Logo
Menu