AusweisApp2/src/network/HttpServerRequestor.h

41 lines
837 B
C
Raw Normal View History

2017-07-03 09:30:10 +02:00
/*
* \brief Sends one time GET requests to server.
*
2019-05-22 10:08:38 +02:00
* \copyright Copyright (c) 2014-2019 Governikus GmbH & Co. KG, Germany
2017-07-03 09:30:10 +02:00
*/
#pragma once
#include <QEventLoop>
#include <QHostAddress>
#include <QNetworkReply>
#include <QPointer>
#include <QScopedPointer>
#include <QTimer>
namespace governikus
{
class HttpServerRequestor
: public QObject
{
Q_OBJECT
private:
QEventLoop mEventLoop;
QTimer mTimer;
QScopedPointer<QNetworkReply> mReply;
public:
HttpServerRequestor();
virtual ~HttpServerRequestor();
QPointer<QNetworkReply> request(const QUrl& pUrl, int pTimeOut = 2000);
2019-01-03 15:06:22 +01:00
static QUrl createUrl(const QString& pQuery, quint16 pPort, const QHostAddress& pHost = QHostAddress::LocalHost, const QString& pPath = QStringLiteral("/eID-Client"));
2017-07-03 09:30:10 +02:00
private Q_SLOTS:
void finished();
};
2019-01-03 15:06:22 +01:00
} // namespace governikus