101 Switching Protocols

HTTP 101 Switching Protocols is a 1xx informational status. The server agrees to switch to the protocol named in the client's Upgrade header.

101Status code
1xxInformational
NoCacheable by default
RFC 9110 §15.2.2Defined in

Common causes

What to do

Expected during WebSocket setup. If a proxy strips the Upgrade header, the handshake fails instead.

Example response

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

Returning 101 in code

Express   res.status(101).json({ … });
Flask     return jsonify(…), 101
PHP       http_response_code(101);
Go        w.WriteHeader(101)

Other 1xx codes

Frequently asked questions

What does HTTP 101 mean?
The server agrees to switch to the protocol named in the client's Upgrade header.
Is 101 an error?
No. 1xx codes are informational responses, not errors.