Skip to content
Client RHAPI Qt/C++
C++ QMake
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
QtRHAPIClient.pro
README.md
main.cpp
mainwindow.cpp
mainwindow.h
rhapiclient.cpp
rhapiclient.h

README.md

QtRHAPIClient

Un client RHAPI Qt/C++

RHAPI is a RESTful Health API

Installation

Qt RHAPIClient est constitué des 2 fichiers :

  • rhapiclient.h
  • rhapiclient.cpp

Le projet Qt *.pro doit comporter les lignes suivantes :

QT += network
SOURCES += rhapiclient.cpp
HEADERS += rhapiclient.h

Usage

Voir l'exemple fourni et les tests sur mainwindow.cpp.

Mise en oeuvre basique :

#include "rhapiclient.h"
// Exemple : requête CCAM sur un mot clef
RHAPIClient* client = new RHAPIClient("https://auth-dev.rhapi.net", "bXlhcHzTA6bXlhcH", this);
QVariantMap error, datas;
if (client->auth("username", "YfdfR5g", error)) {
    QList<QPair<QString, QString>> params;
    params << (qMakePair(QString("texte"), QString("biopsie")));
    if (client->get("CCAM", params, datas)) {
        qDebug() << datas;
    }
    else {
        qWarning() << datas.value("userMessage").toString();
    }
}
else {
    qWarning() << error.value("userMessage").toString();
}
You can’t perform that action at this time.