06-09-2024 02:18 PM
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
06-11-2024 08:33 AM
Too little information to provide help. What is the API? Does the site send a response at all?
06-15-2024 02:55 AM
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.