Skip to content

FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.

1.0 KB
Raw Blame
#include "services/data_normalization/DataMappingTestClient.h"

#include "network/http/HttpClient.h"

namespace fincept::services {

DataMappingTestClient& DataMappingTestClient::instance() {
    static DataMappingTestClient s;
    return s;
}

void DataMappingTestClient::test_api(Method method, const QString& url, const QJsonObject& body, const QObject* context,
                                     Callback callback, const QMap<QByteArray, QByteArray>& headers) {
    auto& http = HttpClient::instance();
    switch (method) {
        case Method::Get:
            http.get(url, std::move(callback), context, headers);
            return;
        case Method::Post:
            http.post(url, body, std::move(callback), context, headers);
            return;
        case Method::Put:
            http.put(url, body, std::move(callback), context, headers);
            return;
        case Method::Delete:
            http.del(url, body, std::move(callback), context, headers);
            return;
    }
}

} // namespace fincept::services