Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. HTTP
  3. Reference
  4. HTTP response status codes
  5. 101 Switching Protocols

101 Switching Protocols

The HTTP101 Switching Protocolsinformational response status code indicates the protocol that a server has switched to.The protocol is specified in theUpgrade request header received from a client.

The server includes anUpgrade header in this response to indicate the protocol it has agreed to switch to.The process is described in detail in theProtocol upgrade mechanism guide.

Status

http
101 Switching Protocols

Examples

Switching protocols to WebSockets

The following example shows how switching protocols might be used withWebSockets.A client sends aGET HTTP request with anUpgrade header which must also be listed in theConnection 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 setSec-WebSocket-* headers for handshake negotiation can be found inWebSocket-specific headers.

http
GET /notifications HTTP/1.1Host: example.comUpgrade: websocketConnection: Upgrade
http
HTTP/1.1 101 Switching ProtocolsUpgrade: websocketConnection: Upgrade

Specifications

Specification
HTTP Semantics
# status.101

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp