101Status code
1xxInformational
NoCacheable by default
RFC 9110 §15.2.2Defined in
Common causes
- WebSocket handshake (
Upgrade: websocket) - Upgrade from HTTP/1.1 to h2c
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)