#ifndef HTTPTHREAD_H
#define HTTPTHREAD_H

#include <QObject>
#include <QDateTime>
#include <QTimer>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QSslConfiguration>
#include <QJsonDocument>
#include <QJsonArray>
#include <QJsonObject>
#include <QJsonValue>
#include <QJsonParseError>
#include "../QReplyTimeout.h"

class HttpThread : public QObject
{
    Q_OBJECT
public:
    explicit HttpThread(QObject *parent = nullptr);
    void run();
    void stop();

signals:
    void dataLog(QString log);
    void mqttData(QString mqtt_msg);

public slots:
    void time_out();
    void finishedSlot(QNetworkReply *reply);
    void reply_timeout();

private:
    bool isWaiting;
    bool keep;
    int minute,hour;
    QNetworkAccessManager *networkManager;
    QSslConfiguration config;
    QTimer *timer;


};

#endif // HTTPTHREAD_H
