#ifndef PQNETWORKACCESSMANAGER_H
#define PQNETWORKACCESSMANAGER_H

#include <QNetworkAccessManager>
#include <pqobject.h>

#include "pqnetworkrequest.h"
#include "pqnetworkreply.h"

class PQNetworkAccessManager : public QNetworkAccessManager
{
    Q_OBJECT
    PQ_OBJECT_EX(QNetworkAccessManager)

public:
    Q_INVOKABLE explicit PQNetworkAccessManager(QObject *parent = Q_NULLPTR);
    ~PQNetworkAccessManager();

    Q_INVOKABLE PQNetworkReply *head(PQObject *request);
    Q_INVOKABLE PQNetworkReply *get(PQObject *request);
    //QNetworkReply *post(const QNetworkRequest &request, QIODevice *data);
    Q_INVOKABLE PQNetworkReply *post(PQObject *request, const QByteArray &data);
    //QNetworkReply *post(const QNetworkRequest &request, QHttpMultiPart *multiPart);
    //QNetworkReply *put(const QNetworkRequest &request, QIODevice *data);
    Q_INVOKABLE PQNetworkReply *put(PQObject *request, const QByteArray &data);
    //QNetworkReply *put(const QNetworkRequest &request, QHttpMultiPart *multiPart);
    Q_INVOKABLE PQNetworkReply *deleteResource(PQObject *request);

public slots:
    PQ_ON_SIGNAL_DECL_START {
        PQOBJECT_ON_SIGNALS();
    } PQ_ON_SIGNAL_DECL_END
};

#endif // PQNETWORKACCESSMANAGER_H
