21 #ifndef ASYNCWEBACCESS_H_ 22 #define ASYNCWEBACCESS_H_ 24 #include "AbstractWebAccess.h" 25 #include "Utils/Pimpl.h" 55 enum class Status : uint8_t
75 AsyncWebAccess(QObject* parent=
nullptr,
const QByteArray& header=QByteArray(),
84 QByteArray
data()
const;
119 void run(
const QString&
url,
int timeout=4000);
127 void runPost(
const QString&
url,
const QByteArray& postData,
int timeout=4000);
139 AsyncWebAccess::Status
status()
const;
148 void stop()
override;
153 void dataAvailable();
161 void redirected(
const QUrl&
url);
171 void redirectRequest(QString redirecUurl);
bool hasError() const
Indicates if error.
QImage image() const
get fetched data formatted as image
QByteArray data() const
get fetched data
bool hasData() const
indicates, if data is avaialbe
void setRawHeader(const QMap< QByteArray, QByteArray > &header)
modify header.
AsyncWebAccess(QObject *parent=nullptr, const QByteArray &header=QByteArray(), AsyncWebAccess::Behavior behavior=AsyncWebAccess::Behavior::AsBrowser)
AsyncWebAccess constructor.
Behavior
The Behavior enum. Responsible for the user-agent variable in the HTTP header.
Definition: AsyncWebAccess.h:46
Asynchgronous web access class.
Definition: AsyncWebAccess.h:35
QString url() const
get last called url. This url may differ from the originally called url when request has been redire...
void run(const QString &url, int timeout=4000)
starts a GET request
AsyncWebAccess::Status status() const
Request Status.
void runPost(const QString &url, const QByteArray &postData, int timeout=4000)
starts a POST request
void setBehavior(AsyncWebAccess::Behavior behavior)
Set the behaviour how sayonara should be recognized by the server. This variable will set the user-ag...
Definition: AbstractWebAccess.h:26