39 #ifndef __OPENFLUID_UTILS_RESTCLIENT_HPP__ 40 #define __OPENFLUID_UTILS_RESTCLIENT_HPP__ 43 #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) 44 # define OPENFLUID_REST_URL_REDIRECT 1 46 # define OPENFLUID_REST_URL_REDIRECT 0 67 int m_StatusCode = -1;
69 unsigned int m_NetworkErrorCode = 0;
71 QString m_NetworkErrorString;
80 Reply(
int StatusCode,
unsigned int NetworkErrorCode,
const QString& NetworkErrorString,
const QString& Content):
81 m_StatusCode(StatusCode),
82 m_NetworkErrorCode(NetworkErrorCode),
83 m_NetworkErrorString(NetworkErrorString),
88 {
return m_StatusCode; }
91 {
return m_NetworkErrorCode; }
94 {
return m_NetworkErrorString; }
100 {
return m_NetworkErrorCode == 0 && m_StatusCode >= 200 && m_StatusCode < 300; }
113 QSslSocket::PeerVerifyMode m_CertificateVerifyMode;
121 {
return m_CertificateVerifyMode; }
124 { m_CertificateVerifyMode = Mode; }
134 Reply performRequest(
const QString& Path,
const QString& Method,
const QString& Data =
"")
const;
144 void setBaseURL(
const QString& URL);
147 {
return m_BaseURL; }
150 { m_SSLConfiguration = Config; }
153 {
return m_SSLConfiguration; }
155 Reply getResource(
const QString& Path)
const;
157 Reply postResource(
const QString& Path,
const QString& Data)
const;
159 Reply putResource(
const QString& Path,
const QString& Data)
const;
161 Reply patchResource(
const QString& Path,
const QString& Data)
const;
163 Reply deleteResource(
const QString& Path,
const QString& Data)
const;
void setSSLConfiguration(const SSLConfiguration &Config)
Definition: RESTClient.hpp:149
QSslSocket::PeerVerifyMode getCertificateVerifyMode() const
Definition: RESTClient.hpp:120
SSLConfiguration getSSLConfiguration() const
Definition: RESTClient.hpp:152
~RESTClient()
Definition: RESTClient.hpp:141
Definition: RESTClient.hpp:109
void setCertificateVerifyMode(QSslSocket::PeerVerifyMode Mode)
Definition: RESTClient.hpp:123
QString getBaseURL() const
Definition: RESTClient.hpp:146
int getStatusCode() const
Definition: RESTClient.hpp:87
SSLConfiguration()
Definition: RESTClient.hpp:117
Definition: RESTClient.hpp:63
QString getNetworkErrorString() const
Definition: RESTClient.hpp:93
void clear()
Definition: RESTClient.hpp:102
int getNetworkErrorCode() const
Definition: RESTClient.hpp:90
bool isOK() const
Definition: RESTClient.hpp:99
QString getContent() const
Definition: RESTClient.hpp:96
Definition: ApplicationException.hpp:47
Reply(int StatusCode, unsigned int NetworkErrorCode, const QString &NetworkErrorString, const QString &Content)
Definition: RESTClient.hpp:80
#define OPENFLUID_API
Definition: dllexport.hpp:86
Definition: RESTClient.hpp:58