QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
|
HTTP request/response manager that is redirect-aware. More...
#include <qgshttptransaction.h>
Public Slots | |
void | abort () |
Aborts the current transaction. More... | |
void | dataFinished (int id, bool error) |
void | dataHeaderReceived (const QHttpResponseHeader &resp) |
void | dataProgress (int done, int total) |
void | dataReceived (const QHttpResponseHeader &resp) |
void | dataStarted (int id) |
void | dataStateChanged (int state) |
void | networkTimedOut () |
void | transactionFinished (bool error) |
Signals | |
void | dataReadProgress (int theProgress) |
Signal for progress update. More... | |
void | setProgress (int done, int total) |
Legacy code. More... | |
void | statusChanged (const QString &theStatusQString) |
emit a signal to be caught by qgisapp and display a msg on status bar More... | |
void | totalSteps (int theTotalSteps) |
Signal for adjusted number of steps. More... | |
Public Member Functions | |
QgsHttpTransaction (const QString &uri, const QString &proxyHost=QString(), int proxyPort=80, const QString &proxyUser=QString(), const QString &proxyPass=QString(), QNetworkProxy::ProxyType proxyType=QNetworkProxy::NoProxy, const QString &userName=QString(), const QString &password=QString()) | |
Constructor. More... | |
virtual | ~QgsHttpTransaction () |
Destructor. More... | |
QString | errorString () |
If an operation returns 0 (e.g. More... | |
void | getAsynchronously () |
bool | getSynchronously (QByteArray &respondedContent, int redirections=0, const QByteArray *postData=nullptr) |
Gets the response synchronously. More... | |
int | networkTimeout () const |
Returns the network timeout in msec. More... | |
QString | responseContentType () |
void | setCredentials (const QString &username, const QString &password) |
Set the credentials (username and password) More... | |
void | setNetworkTimeout (int msec) |
Sets the network timeout in milliseconds. More... | |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Static Public Member Functions | |
static bool | applyProxySettings (QHttp &http, const QString &url) |
Apply proxy settings from QSettings to a http object. More... | |
Static Public Member Functions inherited from QObject | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Additional Inherited Members | |
Protected Member Functions inherited from QObject | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Static Protected Member Functions inherited from QObject | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
Properties inherited from QObject | |
objectName | |
HTTP request/response manager that is redirect-aware.
This class extends the Qt QHttp concept by being able to recognise and respond to redirection responses (e.g. HTTP code 302)
Definition at line 36 of file qgshttptransaction.h.
QgsHttpTransaction::QgsHttpTransaction | ( | const QString & | uri, |
const QString & | proxyHost = QString() , |
||
int | proxyPort = 80 , |
||
const QString & | proxyUser = QString() , |
||
const QString & | proxyPass = QString() , |
||
QNetworkProxy::ProxyType | proxyType = QNetworkProxy::NoProxy , |
||
const QString & | userName = QString() , |
||
const QString & | password = QString() |
||
) |
Constructor.
Definition at line 38 of file qgshttptransaction.cpp.
|
virtual |
Destructor.
Definition at line 75 of file qgshttptransaction.cpp.
|
slot |
Aborts the current transaction.
Definition at line 563 of file qgshttptransaction.cpp.
Apply proxy settings from QSettings to a http object.
Definition at line 506 of file qgshttptransaction.cpp.
|
slot |
Definition at line 343 of file qgshttptransaction.cpp.
|
slot |
Definition at line 268 of file qgshttptransaction.cpp.
|
slot |
Definition at line 318 of file qgshttptransaction.cpp.
|
signal |
Signal for progress update.
|
slot |
Definition at line 299 of file qgshttptransaction.cpp.
|
slot |
Definition at line 261 of file qgshttptransaction.cpp.
|
slot |
Definition at line 436 of file qgshttptransaction.cpp.
QString QgsHttpTransaction::errorString | ( | ) |
If an operation returns 0 (e.g.
getSynchronously()), this function returns the text of the error associated with the failure. Interactive users of this provider can then, for example, call a QMessageBox to display the contents.
Definition at line 501 of file qgshttptransaction.cpp.
void QgsHttpTransaction::getAsynchronously | ( | ) |
Definition at line 86 of file qgshttptransaction.cpp.
bool QgsHttpTransaction::getSynchronously | ( | QByteArray & | respondedContent, |
int | redirections = 0 , |
||
const QByteArray * | postData = nullptr |
||
) |
Gets the response synchronously.
Note that signals will still be emitted while in this function.
The function returns false if there is an error while getting the response.
[out] | respondedContent | is replaced with the new content. |
[in] | redirections | is used to measure how many http redirections we've been through. Clients typically don't need to set this. |
postData | data to send with the http message. This is only used for HTTP POST. If 0 then the request is done with HTTP GET. |
Definition at line 93 of file qgshttptransaction.cpp.
|
slot |
Definition at line 489 of file qgshttptransaction.cpp.
|
inline |
Returns the network timeout in msec.
Definition at line 94 of file qgshttptransaction.h.
QString QgsHttpTransaction::responseContentType | ( | ) |
Definition at line 255 of file qgshttptransaction.cpp.
Set the credentials (username and password)
Definition at line 81 of file qgshttptransaction.cpp.
|
inline |
Sets the network timeout in milliseconds.
Definition at line 96 of file qgshttptransaction.h.
|
signal |
Legacy code.
This signal is currently not emitted and only kept for API compatibility
|
signal |
emit a signal to be caught by qgisapp and display a msg on status bar
|
signal |
Signal for adjusted number of steps.
|
slot |
Definition at line 392 of file qgshttptransaction.cpp.