LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sending Json with websocket

Hello,

I want to sen this JSON using websocket connection:

{
  "jsonrpc": "2.0",
  "method": "subscription",
  "params": "2A"
}

using this add-on: WebSockets Toolkit for LabVIEW - VIPM by JKI,
I can create websocket connection with the website that I want to communicate with,

and I can send normal string and receive,

but I can't send JSON data like this, to subscribe events from the site.

When I send this JSON data like normal string, the website doesn't deal with it as command,
anyone has an idea to do that!!

 

Thanks in advance

0 Kudos
Message 1 of 3
(338 Views)

Too little information to provide help. What is the API? Does the site send a response at all?

0 Kudos
Message 2 of 3
(258 Views)

Thank you for your reply.

Actually I think my example wasn't correct 100%.

 

I need a VI to open webSocket connection with some website,
and listen to events on that website.

 

do you have an example to do that?

 

I use the package named  'websockets' from JKI.
it does has examples to open websocket and send/receive string from the server,
but I couldn't see or modify an example to listen to event from server.

 

I read that I should send as JSON request to do that as I mentioned earlier  but I couldn't


I could do that by calling API from the server but I need to use webSocket,

I don't need to make many requests to get new data.

 

0 Kudos
Message 3 of 3
(229 Views)