11 #include "webserverquery.hpp"
13 using namespace Huggle;
15 WebserverQuery::WebserverQuery()
28 this->
Result->Failed =
true;
30 this->Status = StatusInError;
33 this->StartTime = QDateTime::currentDateTime();
34 this->Status = StatusProcessing;
37 QUrl url = QUrl::fromEncoded(this->
URL.toUtf8());
38 QNetworkRequest request(url);
41 request.setHeader(QNetworkRequest::ContentTypeHeader,
"application/x-www-form-urlencoded");
46 this->reply = Query::NetworkManager.post(request, this->
Parameters.toUtf8());
49 this->reply = Query::NetworkManager.get(request);
51 QObject::connect(this->reply, SIGNAL(finished()),
this, SLOT(Finished()));
52 QObject::connect(this->reply, SIGNAL(readyRead()),
this, SLOT(ReadData()));
61 void WebserverQuery::ReadData()
66 void WebserverQuery::Finished()
void Kill()
Terminate the query.
bool UsingPOST
Whether the query will submit parameters using POST data.
static void DebugLog(QString Message, unsigned int Verbosity=1)
This log is only shown if verbosity is same or larger than requested verbosity.
QString ErrorMessage
If query is in error the reason for error is stored here.
QString Parameters
Parameters for action, for example page title.
QueryResult * Result
Result of query, see documentation of QueryResult for more.