101 Switching Protocols

Estimated reading: 1 minute 2963 views

A response code that indicating a request to change protocols. The requested protocol is specified in the ‘Upgrade’ header.

Usually this status is not seen by the user as it is used for server requests. This status if seen by the user indicates that the server will be changing the HTTP protocol.

If no other status or errors are displayed and the user is able to proceed, then no other action is needed. Yet, if another status or error is displayed then troubleshoot according to extra codes.

The HTTP 101 Switching Protocols response code indicates a protocol to which the server switches. The protocol is specified in the Upgrade request header received from a client.

The server includes in this response an Upgrade response header to indicate the protocol it switched to. The process is described in the following article: Protocol upgrade mechanism.

Status

101 Switching Protocols

Examples

Switching protocols might be used with WebSockets.

HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade

Specifications

SpecificationTitle
RFC 7231, section 6.2.2: 101 Switching ProtocolHypertext Transfer Protocol (HTTP/1.1): Semantics and Content