General explanation of the 101 status code
Imagine you are in a restaurant and want to order a drink. The waiter comes up to you and asks for your order. You say, "I'd like a glass of water, but if you have fresh orange juice, I'd prefer that." Here you are basically giving the waiter two options and letting them know you are flexible. The request to switch protocols works similarly.
When a web browser or other client tool sends a request to a server, the client may suggest switching to a different communication protocol because it believes that other protocol would be more efficient or better suited. For example, a client originally using an HTTP connection might suggest switching to WebSockets to provide an always-open connection for real-time data.
When the server accepts this suggestion, it responds with status code 101 Switching Protocols to tell the client, "All right! Let's switch protocols." From that point on, communication between the client and server continues using the new, agreed-upon protocol.
Specification of the HTTP status code 101
Source / Quote by: The 101 Switching Protocols HTTP Status Code is specified by section 6.2.2 of RFC7231.
How to throw a 101 statuscode with PHP?
Test the 101 HTTP status code
In order to be able to display the HTTP status code (in this case 101 Switching Protocols) and other information on the client side, the development console must be opened with F12. Afterwards you have to navigate to the tab "Network". Now you can open the page, in the network tab you should see the web page (example index.php). This must be selected and then the Herder section must be selected. Here the user will see the following result:
Browser compatibility of the 101 status code
|Chrome Android||no data|
|Firefox for Android||no data|
|Opera Android||no data|
|Safari on iOS||no data|
|WebView Android||no data|
Constants in programming languages