ImagingTools Core SDK
IHttpClientRequest.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5// Qt includes
6#include <QtNetwork/QNetworkReply>
7
8// ACF includes
9#include <istd/IChangeable.h>
10
11
12namespace imtrest
13{
14
15
19class IHttpClientRequest: virtual public istd::IChangeable
20{
21public:
23 {
24 RS_CREATED = 0x0000,
26 RS_PROCESSING = 0x0002,
27 RS_FINISHED = 0x0004,
28 RS_NO_ERROR = 0x0008,
29 RS_ERROR = 0x0010
30 };
31
32 virtual QVariant GetAttribute(QNetworkRequest::Attribute code) const = 0;
33 virtual QString GetErrorString() const = 0;
34 virtual QNetworkReply::NetworkError GetErrorType() const = 0;
35 virtual QByteArray GetHeader(const QByteArray &headerName) const = 0;
36 virtual QList<QByteArray> GetHeaderList() const = 0;
37 virtual QNetworkReply* GetReply() const = 0;
38 virtual QByteArray GetReplyBody() const = 0;
39 virtual QNetworkRequest GetRequest() const = 0;
40 virtual QByteArray GetRequestBody() const = 0;
41 virtual QNetworkAccessManager::Operation GetRequestType() const = 0;
42 virtual int GetState() const = 0;
43 virtual QUrl GetUrl() const = 0;
44
45 virtual void SetReply(QNetworkReply* reply) = 0;
46 virtual void SetRequest(const QNetworkRequest& request) = 0;
47 virtual void SetRequestBody(const QByteArray& body) = 0;
48 virtual void SetRequestType(QNetworkAccessManager::Operation requestType) = 0;
49};
50
51
52} // namespace imtrest
53
54
@ RS_ERROR
Processing of the request has been finished with error.
@ RS_PROCESSING
Processing of the request started.
@ RS_NO_ERROR
Processing of the request has been finished with normal result.
@ RS_CREATED
Just created, and not ready to be proceeded.
@ RS_READY_TO_PROCESSING
ready to proceed (When all properties have been set)
@ RS_FINISHED
Processing of the request has been finished.