MKR WiFi Sending Web Socket Data

I am using MKR WiFi with the following libraries as a Web Socket Client :

#include <SPI.h>
#include <WiFiNINA.h>
#include <ArduinoHttpClient.h>
#include <ArduinoJson.h>

I have connected to WiFi and WS server but am struggling to send web socket data to web socket server

Web socket is defined:

WebSocketClient client = WebSocketClient(wifi,serverAddress,port);

and connection opened with:


Serial.println(client.connected()); shows 1 and server also shows a connection

I have tried:

client.println(“hello world”);

webSocketClient.sendData(“hello world”); which does not compile for MKR

Clearly I am missing something here, there are loads of examples posting to HTTP server but none to WS server.

Help please