Qt library providing threaded HTTP operations and an auto-reconnecting MQTT client.
Modules
| Module | Description |
| HTTP | Threaded GET, POST, PUT, DELETE, and multipart upload via QNetworkAccessManager |
| MQTT | Auto-reconnecting MQTT 5.0 / 3.1.1 client with SSL/TLS support |
Quick Start
HTTP GET
#include <Kanoop/http/httpget.h>
HttpGet get(
"https://api.example.com/data");
get.addParameter("page", "1");
qDebug() << get.statusCode() << get.responseBody();
});
get.start();
HTTP GET operation executed asynchronously on a dedicated thread.
void operationComplete()
Emitted when the HTTP operation has completed.
HTTP POST (JSON)
#include <Kanoop/http/httppost.h>
QByteArray json = R"({"name":"test"})";
HttpPost post("https://api.example.com/items", json);
post.appendHeader(QNetworkRequest::ContentTypeHeader, "application/json");
qDebug() << post.statusCode();
});
post.start();
HTTP POST operation executed asynchronously on a dedicated thread.
MQTT Client
#include <Kanoop/mqtt/mqttclient.h>
#include <Kanoop/mqtt/mqttparameters.h>
params.setUseSsl(true);
params.setUsername("device-001");
params.setPassword("token");
client.subscribe("sensors/temperature");
client.publish("status/online", "1");
});
client.start();
MQTT client wrapper providing connection management, auto-reconnect, and SSL support.
void clientConnected()
Emitted when the client connects to the broker.
Encapsulates connection parameters for an MQTT broker.
Building
cmake -S . -B build -G Ninja -DCMAKE_PREFIX_PATH=/path/to/Qt/6.x/gcc_64
cmake --build build --parallel
Requires KanoopCommonQt as a dependency.
Links