70 void fetchContent(
const QNetworkRequest &request,
const QString &authcfg = QString() );
76 QNetworkReply *
reply();
122 void errorOccurred( QNetworkReply::NetworkError code,
const QString &errorMsg );
127 std::unique_ptr<QNetworkReply> mReply;
129 bool mContentLoaded =
false;
131 bool mIsCanceled =
false;
138 QTextCodec *codecForHtml( QByteArray &array )
const;
146 void contentLoaded(
bool ok =
true );
QgsNetworkContentFetcher()=default
QString contentDispositionFilename() const
Returns the associated filename from the reply's content disposition header, if present.
void fetchContent(const QUrl &url, const QString &authcfg=QString(), const QgsHttpHeaders &headers=QgsHttpHeaders())
Fetches content from a remote URL and handles redirects.
void finished()
Emitted when content has loaded.
bool wasCanceled() const
Returns true if the fetching was canceled.
void errorOccurred(QNetworkReply::NetworkError code, const QString &errorMsg)
Emitted when an error with code error occurred while processing the request errorMsg is a textual des...
void cancel()
Cancels any ongoing request.
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
Emitted when data is received.
QNetworkReply * reply()
Returns a reference to the network reply.
QString contentAsString() const
Returns the fetched content as a string.