# WebSocket status code of 200 but Postman calls it an error

**URL:** <https://community.postman.com/t/websocket-status-code-of-200-but-postman-calls-it-an-error/60017>\
**Category:** Help Hub\
**Tags:** websocket, status-code\
**Created:** [April 16, 2024, 7:21pm UTC](https://community.postman.com/t/websocket-status-code-of-200-but-postman-calls-it-an-error/60017 "2024-04-16T19:21:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmyers44](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@mmyers44](https://community.postman.com/u/mmyers44)\
**Post date:** [April 16, 2024, 7:21pm UTC](https://community.postman.com/t/websocket-status-code-of-200-but-postman-calls-it-an-error/60017/1 "2024-04-16T19:21:53Z")

</div>

I am trying to implement a chatbot which uses WebSocket to connect from the user’s browser to the Oracle Digital Assistant REST endpoint. I am getting an error (seen in the browsers developer tools console):

> WebSocket **connection to** wss://oda-2098097sdjhjk476242-jnajb-da2.data.digitalassistant.oci.oraclecloud.com/botsui//xxxxxx **failed**.

In order to determine why it is failing to connect, I tried testing a WebSocket request using postman. The result said:

> **Could not connect to** wss://oda-2adb07ccffc34e858dd09086cfb194ec-da2.data.digitalassistant.oci.oraclecloud.com/botsui//chat/v1/chats/sockets/websdk?channelId=2f89f2bc-286f-42eb-bc06-4e53fe7da92d&userId=6d99d8e9-

**Error:** Unexpected server response: 200

**Obviously 200 is usually the desired HTTP Response Status Code that we usually want, but Postman is reporting this as an Error and saying that it is not able to connect. I think that the desired response code for a wss handshake is 101 (Switching Protocols).**

So, what does a 200 return code mean during a wss handshake/upgrade request?

###### Handshake Details

Request URL: [https://oda-2adb07ccffc34e858dd09086cfb194ec-da2.data.digitalassistant.oci.oraclecloud.com/botsui//chat/v1/chats/sockets/websdk?channelId=xxxxxxxxxxxxxxxxxx&userId=xxxxxxxxxxxxxxxxxxxxxxxxxx](https://oda-2adb07ccffc34e858dd09086cfb194ec-da2.data.digitalassistant.oci.oraclecloud.com/botsui//chat/v1/chats/sockets/websdk?channelId=xxxxxxxxxxxxxxxxxx&userId=xxxxxxxxxxxxxxxxxxxxxxxxxx)

Request Method: GET  
Status Code: 200 OK

▶Request Headers

Sec-WebSocket-Version: 13  
Sec-WebSocket-Key: Io/rCxtPBawusOgTXNsQQQ==  
Connection: Upgrade  
Upgrade: websocket  
Sec-WebSocket-Extensions: permessage-deflate; client\_max\_window\_bits  
Host: [oda-2adxxxxxxxx6cfb194ec-da2.data.digitalassistant.oci.oraclecloud.com](http://oda-2adxxxxxxxx6cfb194ec-da2.data.digitalassistant.oci.oraclecloud.com)

▶Response Headers

Date: Tue, 16 Apr 2024 18:31:49 GMT  
Content-Type: text/html;charset=utf-8  
Transfer-Encoding: chunked  
Connection: keep-alive  
X-Request-ID: aa1b4c1eb7a3f3ead27a3ccaf88a6a20  
Strict-Transport-Security: max-age=31536000; includeSubDomains

I am running Postman in my browser (MS-EDGE) on Windows 10 using the Desktop Agent

-

---

<div class="post-metadata">

**Author:** ![appurva21](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/appurva21/32/34560_2.png) [@appurva21](https://community.postman.com/u/appurva21)\
**Post date:** [April 17, 2024, 5:50am UTC](https://community.postman.com/t/websocket-status-code-of-200-but-postman-calls-it-an-error/60017/2 "2024-04-17T05:50:41Z")

</div>

Hey @mmyers44, welcome to the community!

As per the [RFC](https://arc.net/l/quote/zkoukhbn) (and as you rightly mentioned), if a client wants to connect to a server over WebSocket, the handshake response should have a 101 (Switching Protocols) status code, which informs the client that the server has agreed to upgrade the connection.

If the server responds with any other status code, the handshake is considered incomplete and continues to be treated as a regular HTTP connection.

In your case, a 200 OK might mean that the endpoint you are trying to connect to only accepts HTTP connection, and there might be a different URL path (or entirely a different URL) that serves over WebSocket.

Lastly, I am not familiar with Oracle Digital Assistant, but looking at the URL, it seems that it serves the chatbot UI, not the one that directly connects you with the chatbot server.

---

<div class="post-metadata">

**Author:** ![mmyers44](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@mmyers44](https://community.postman.com/u/mmyers44)\
**Post date:** [April 17, 2024, 9:31pm UTC](https://community.postman.com/t/websocket-status-code-of-200-but-postman-calls-it-an-error/60017/3 "2024-04-17T21:31:35Z")

</div>

Thanks for the reply.

Your comment made me look closer at the uri and that was the problem. I removed the path “/botsui/” from the uri that was used to generate the full path and that is what was causing this issue

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [May 17, 2024, 9:32pm UTC](https://community.postman.com/t/websocket-status-code-of-200-but-postman-calls-it-an-error/60017/4 "2024-05-17T21:32:37Z")

</div>

Closed on May 17, 2024, 9:32pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
