title: Getting Response code was not 101: 400 in Java Websocket API client
body: <p>I have the following <code>WebSocket</code> client code in Java.</p>
  
  <pre><code>final ClientEndpointConfig cec = ClientEndpointConfig.Builder.create().build();
  
              ClientManager client = ClientManager.createClient();
              client.connectToServer(new Endpoint() {
  
                  @Override
                  public void onOpen(Session session, EndpointConfig config) {
                      try {
                          session.addMessageHandler((MessageHandler.Whole&lt;String&gt;) message -&gt; {
                              System.out.println("Received message: "+message);
                          });
                          session.getBasicRemote().sendText(SENT_MESSAGE);
                      } catch (IOException e) {
                          e.printStackTrace();
                      }
                  }
              }, cec, new URI("wss://ws.bitso.com"));
          } catch (Exception e) {
              e.printStackTrace();
          }
  </code></pre>
  
  <p>For some reason, I'm getting this error.</p>
  
  <pre><code>org.glassfish.tyrus.core.HandshakeException: Response code was not 101: 400
  </code></pre>
  
  <p>What could be the reason?</p>