 |
Sayonara Player
|
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(),
119 void run(
const QString&
url,
int timeout=4000);
127 void runPost(
const QString&
url,
const QByteArray& postData,
int timeout=4000);
148 void stop()
override;
153 void dataAvailable();
161 void redirected(
const QUrl&
url);
171 void redirectRequest(QString redirecUurl);
void setBehavior(AsyncWebAccess::Behavior behavior)
Set the behaviour how sayonara should be recognized by the server. This variable will set the user-ag...
void run(const QString &url, int timeout=4000)
starts a GET request
AsyncWebAccess(QObject *parent=nullptr, const QByteArray &header=QByteArray(), AsyncWebAccess::Behavior behavior=AsyncWebAccess::Behavior::AsBrowser)
AsyncWebAccess constructor.
Asynchgronous web access class.
Definition: AsyncWebAccess.h:38
QString url() const
get last called url. This url may differ from the originally called url when request has been redire...
bool hasData() const
indicates, if data is avaialbe
Behavior
The Behavior enum. Responsible for the user-agent variable in the HTTP header.
Definition: AsyncWebAccess.h:47
void runPost(const QString &url, const QByteArray &postData, int timeout=4000)
starts a POST request
Definition: AbstractWebAccess.h:27
void setRawHeader(const QMap< QByteArray, QByteArray > &header)
modify header.
QImage image() const
get fetched data formatted as image
QByteArray data() const
get fetched data
bool hasError() const
Indicates if error.
AsyncWebAccess::Status status() const
Request Status.