15#ifndef QGSNETWORKREPLY_H
16#define QGSNETWORKREPLY_H
20#include <QNetworkReply>
56 QVariant attribute( QNetworkRequest::Attribute code )
const;
66 QMap< QNetworkRequest::Attribute, QVariant >
attributes()
const {
return mAttributes; }
75 QNetworkReply::NetworkError
error()
const
103 return mRawHeaderPairs;
113 bool hasRawHeader(
const QByteArray &headerName )
const;
121 QList<QByteArray> rawHeaderList()
const;
130 QByteArray rawHeader(
const QByteArray &headerName )
const;
140 QNetworkRequest
request()
const {
return mRequest; }
148 void setContent(
const QByteArray &content ) { mContent = content; }
158 QByteArray
content()
const {
return mContent; }
165 static QString extractFilenameFromContentDispositionHeader( QNetworkReply *reply );
172 static QString extractFileNameFromContentDispositionHeader(
const QString &header );
176 QNetworkReply::NetworkError mError = QNetworkReply::NoError;
177 QString mErrorString;
178 QList<RawHeaderPair> mRawHeaderPairs;
179 QMap< QNetworkRequest::Attribute, QVariant > mAttributes;
181 QNetworkRequest mRequest;
Encapsulates a network reply within a container which is inexpensive to copy and safe to pass between...
const QList< RawHeaderPair > & rawHeaderPairs() const
Returns the list of raw header pairs in the reply.
QgsNetworkReplyContent()=default
Default constructor for an empty reply.
QString errorString() const
Returns the error text for the reply, or an empty string if no error was encountered.
void setContent(const QByteArray &content)
Sets the reply content.
QByteArray content() const
Returns the reply content.
QNetworkReply::NetworkError error() const
Returns the reply's error message, or QNetworkReply::NoError if no error was encountered.
QMap< QNetworkRequest::Attribute, QVariant > attributes() const
Returns a list of valid attributes received in the reply.
int requestId() const
Returns the unique ID identifying the original request which this response was formed from.
QPair< QByteArray, QByteArray > RawHeaderPair
QNetworkRequest request() const
Returns the original network request.