HTTP network content fetcher.
More...
#include <qgsnetworkcontentfetcher.h>
|
void | downloadProgress (qint64 bytesReceived, qint64 bytesTotal) |
| Emitted when data is received. More...
|
|
void | errorOccurred (QNetworkReply::NetworkError code, const QString &errorMsg) |
| Emitted when an error with code error occurred while processing the request errorMsg is a textual description of the error. More...
|
|
void | finished () |
| Emitted when content has loaded. More...
|
|
HTTP network content fetcher.
A simple method for fetching remote HTTP content and converting the content to standard formats. Url redirects are automatically handled.
- See also
- QgsNetworkContentFetcherTask
- Since
- QGIS 2.5
Definition at line 39 of file qgsnetworkcontentfetcher.h.
◆ QgsNetworkContentFetcher()
QgsNetworkContentFetcher::QgsNetworkContentFetcher |
( |
| ) |
|
|
default |
◆ ~QgsNetworkContentFetcher()
QgsNetworkContentFetcher::~QgsNetworkContentFetcher |
( |
| ) |
|
|
override |
◆ cancel()
void QgsNetworkContentFetcher::cancel |
( |
| ) |
|
◆ contentAsString()
QString QgsNetworkContentFetcher::contentAsString |
( |
| ) |
const |
◆ contentDispositionFilename()
QString QgsNetworkContentFetcher::contentDispositionFilename |
( |
| ) |
const |
Returns the associated filename from the reply's content disposition header, if present.
- Since
- QGIS 3.28
Definition at line 100 of file qgsnetworkcontentfetcher.cpp.
◆ downloadProgress
void QgsNetworkContentFetcher::downloadProgress |
( |
qint64 |
bytesReceived, |
|
|
qint64 |
bytesTotal |
|
) |
| |
|
signal |
Emitted when data is received.
- Since
- QGIS 3.2
◆ errorOccurred
void QgsNetworkContentFetcher::errorOccurred |
( |
QNetworkReply::NetworkError |
code, |
|
|
const QString & |
errorMsg |
|
) |
| |
|
signal |
Emitted when an error with code error occurred while processing the request errorMsg is a textual description of the error.
- Since
- QGIS 3.22
◆ fetchContent() [1/2]
void QgsNetworkContentFetcher::fetchContent |
( |
const QNetworkRequest & |
request, |
|
|
const QString & |
authcfg = QString() |
|
) |
| |
Fetches content using a network request and handles redirects.
The finished() signal will be emitted when content has been fetched.
Optionally, authentication configuration can be set via the authcfg argument.
- Since
- QGIS 3.2
Definition at line 46 of file qgsnetworkcontentfetcher.cpp.
◆ fetchContent() [2/2]
void QgsNetworkContentFetcher::fetchContent |
( |
const QUrl & |
url, |
|
|
const QString & |
authcfg = QString() |
|
) |
| |
Fetches content from a remote URL and handles redirects.
The finished() signal will be emitted when content has been fetched.
- Parameters
-
url | URL to fetch |
authcfg | optional authentication configuration |
Definition at line 38 of file qgsnetworkcontentfetcher.cpp.
◆ finished
void QgsNetworkContentFetcher::finished |
( |
| ) |
|
|
signal |
Emitted when content has loaded.
◆ reply()
QNetworkReply * QgsNetworkContentFetcher::reply |
( |
| ) |
|
◆ wasCanceled()
bool QgsNetworkContentFetcher::wasCanceled |
( |
| ) |
const |
The documentation for this class was generated from the following files: