-
Notifications
You must be signed in to change notification settings - Fork 0
/
requestscreencontroller.h
35 lines (27 loc) · 1023 Bytes
/
requestscreencontroller.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef REQUESTSCREENCONTROLLER_H
#define REQUESTSCREENCONTROLLER_H
#include <QObject>
#include <QUrlQuery>
#include "httprequest.h"
#include "httpresponse.h"
class RequestScreenController : public QObject
{
Q_OBJECT
public:
explicit RequestScreenController(QObject *parent = nullptr);
void newRequest(QUrl *url,QString *requestMethod,
QMap<QString,QString> *headers, QUrlQuery *urlQuery);
void newRequest( QUrl *url, QString *requestMethod,
QMap<QString,QString> *headers, QByteArray* body);
void newRequest( QUrl *url, QString *requestMethod,
QMap<QString,QString> *headers, QByteArray* body, QUrlQuery *urlQuery);
void newRequest(QUrl *url);
void start();
void cancelRequest();
void setResponseCallback(const std::function<void(HttpResponse)> callback);
~RequestScreenController();
private:
std::function<void(HttpResponse)> callback;
HttpRequest *req = nullptr;
};
#endif // REQUESTSCREENCONTROLLER_H