#ifndef APICLIENT_H #define APICLIENT_H #include "../qEmbyCore_global.h" #include "networkmanager.h" #include "../models/profile/serverprofile.h" #include #include #include #include class QEMBYCORE_EXPORT ApiClient : public QObject { Q_OBJECT public: explicit ApiClient(const ServerProfile& profile, NetworkManager* nm, QObject* parent = nullptr); QCoro::Task get(const QString& path); QCoro::Task getText(const QString& path); QCoro::Task post(const QString& path, const QJsonObject& payload); QCoro::Task postArray(const QString& path, const QJsonArray& payload); QCoro::Task postBytes(const QString& path, QByteArray payload, QString contentType); QCoro::Task postForm(const QString& path, const QUrlQuery& formData); QCoro::Task deleteResource(const QString& path); private: ServerProfile m_profile; NetworkManager* m_network; QMap getAuthHeaders() const; NetworkRequestOptions requestOptions() const; }; #endif