Fix a spell miss of document.
[AGL/documentation.git] / docs / 3_Developer_Guides / 4_AFB_Helper_Guide / 6_Qt_AFB_Websocket_client.md
1 ---
2 title: Qt AFB Websocket client
3 ---
4
5 ## QAfbWebsocketClient(QObject* parent = nullptr)
6
7 Default constructor.
8
9 * `parent`: Parent object.
10
11 ## QAbstractSocket::SocketError error()
12
13 Get and return the last error code.
14
15 ## QString errorString()
16
17 Get and return the last error as a string.
18
19 ## bool isValid()
20
21 Check if connection is ready or not.
22
23 Returns `true` if the connected is ready to read and write, `false` otherwise.
24
25 ## void call(const QString& api, const QString& verb, const QJsonValue& arg = QJsonValue(), closure_t closure = nullptr)
26
27 Call an api's verb with an argument.
28
29 * `api`: Api to call.
30 * `verb`: Verb to call.
31 * `arg`: Argument to pass.
32 * `closure`: callback function to call at the verb reply
33
34 ## void QAfbWebsocketClient::sendTextMessage(QString msg)
35
36 Send a text message over the websocket.
37
38 This is use for test only, you should not use this method because it sent text
39 **as-is**, so you have to follow the binder's protocol by your self.
40
41 * `msg`: Message to send.