BloggingBIG Logo
Search
  • Blogs
  • How we work
  • Write Guest Post
Get started

HTTP Status Code 101-Switching Protocols

by Saurabh Chalise

  • 3 min read
    • HTTP Status
Share this content
HTTP Status Code 101-Switching Protocols image

Navigation

  • What do HTTP Status Code 101 mean?
    • Examples
  • Upgrade
  • Status
  • Specifications
  • 101 CODE REFERENCES
  • FAQs
    • What is the example of the 101 Switching Protocols?
    • Is WebSocket a protocol?
    • What does HTTP Status Code 101 mean?
  • Conclusion

What do HTTP Status Code 101 mean?

The HTTP Status 101 (Switching Protocols) represents that the client has asked the server in order to change the protocols and the server has agreed to do so. In another word, It indicates that the server understands and is asking the client to send the request, via the Upgrade header field for the change in application protocols after the empty line terminates the 101 response.

Examples

WebSocket Protocol is one of the best examples of status code 101-Switching Protocol.

It uses an HTTP handshake while creating the connection, especially for security purposes.

WebSocket client starts the connection, then the first few bytes look like this :

GET /chat HTTP/1.1Host: server.example.comUpgrade: WebSocketConnection: UpgradeSec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==Origin: http://example.comSec-WebSocket-Protocol: chat, superchatSec-WebSocket-Version: 13

If the Server supports WebSocket, it will respond with HTTP status code101-Switching Protocols and then switch to the WebSocket protocol:

HTTP/1.1 101 Switching ProtocolsUpgrade:WebSocket connection: UpgradeSec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=Sec-WebSocket-Protocol: chat

Source:https://evertpot.com/http/101-switching-protocols

Upgrade

This header field provides a mechanism for transitions from HTTP/1.1 to some other protocol on the same connection. When the list of protocols is provided in the Upgrade header file, then the Upgrade field requests the server to switch to one or more of those protocols, before sending the final response. When the server wishes to continue using the current protocol on that connection, then it may ignore a received Upgrade header field.

Status

101 Switching Protocols

Specifications

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

101 CODE REFERENCES

Rails HTTP Status Symbol:switching_protocols
Go HTTP Status Constanthttp.StatusSwitchingProtocols
Symfony HTTP Status ConstantResponse::HTTP_SWITCHING_PROTOCOLS

Python2 HTTP Status Constant
httplib.SWITCHING_PROTOCOLS
Python3+ HTTP Status Constanthttp.client.SWITCHING_PROTOCOLS
Python3.5+ HTTP Status Constanthttp.HTTPStatus.SWITCHING_PROTOCOLS

Read more: HTTP Status Code 302 Found

FAQs

What is the example of the 101 Switching Protocols?

WebSocket protocol is one of the examples of 101 Switching Protocol.

Is WebSocket a protocol?

Yes, WebSocket is an independent TCP-based communication protocol. It provides full-duplex communication channels over a single TCP connection. Its connection with HTTP is that its handshake is interpreted by HTTP servers as an Upgrade request.

What does HTTP Status Code 101 mean?

The HTTP Status 101 (Switching Protocols) represents that the client has asked the server in order to change the protocols and the server has agreed to do so. In another word, It indicates that the server understands and is asking the client to send the request, via the Upgrade header field for the change in application protocols after the empty line terminates the 101 response.

source: Automation Hub Software Testing

Conclusion

I hope this article was able to help you with your doubts and queries related to the HTTP status code 101-Switching Protocols. Still, if there are any queries related to this topic, feel free to ask in the comment section, we would be happy to assist you. Thank you.

Share
Tweet
Share
0 Shares
Saurabh Chalise image

Saurabh Chalise

Be first to comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

More from HTTP Status

HTTP Status Code 499 Client Closed Request image

HTTP Status Code 499 Client Closed Request

Kedar Dangal image

by Kedar Dangal

  • 4 min read
    • HTTP Status
HTTP Status Code 431 Request Header Fields Too Large image

HTTP Status Code 431 Request Header Fields Too Large

Kedar Dangal image

by Kedar Dangal

  • 4 min read
    • HTTP Status
HTTP Status Code 429-Too Many Request image

HTTP Status Code 429-Too Many Request

Saurabh Chalise image

by Saurabh Chalise

  • 4 min read
    • HTTP Status

Quick links

  • Siteground black friday deals
  • Wp engine black friday deals
  • Greengeeks black friday deals
  • Tmd hosting black friday deals
  • Fastcomet black friday deals
  • Hostwinds black friday deals
  • bluehost black friday
  • Namecheap black friday deals
  • Ionos 1 & 1 black friday deals
  • Hostgator black friday deals
  • ipage black friday deals
  • wpx hosting black friday deals
BloggingBIG logo
  • About
  • DISCLAIMER
  • Disclouser for Blogging BIG
  • Terms and Conditions
  • Privacy Policy
  • Sitemap
Developed by Fnclick
Back To Top