forked from Public/monero-gui
network: provide common HTTP GET functionality with js callbacks
This commit is contained in:
20
src/qt/network.h
Normal file
20
src/qt/network.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QtNetwork>
|
||||
|
||||
#include "FutureScheduler.h"
|
||||
|
||||
class Network : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Network(QObject *parent = nullptr);
|
||||
|
||||
public:
|
||||
Q_INVOKABLE void get(const QString &url, const QJSValue &callback, const QString &contentType = {}) const;
|
||||
Q_INVOKABLE void getJSON(const QString &url, const QJSValue &callback) const;
|
||||
|
||||
private:
|
||||
mutable FutureScheduler m_scheduler;
|
||||
};
|
||||
Reference in New Issue
Block a user