Qyoto
4.0.5
Qyoto is a C# language binding for Qt
|
The QNetworkReply class contains the data and headers for a request sent with QNetworkAccessManager More...
Public Types | |
enum | NetworkError { AuthenticationRequiredError = 204, ConnectionRefusedError = 1, ContentAccessDenied = 201, ContentNotFoundError = 203, ContentOperationNotPermittedError = 202, ContentReSendError = 205, HostNotFoundError = 3, NoError = 0, OperationCanceledError = 5, ProtocolFailure = 399, ProtocolInvalidOperationError = 302, ProtocolUnknownError = 301, ProxyAuthenticationRequiredError = 105, ProxyConnectionClosedError = 102, ProxyConnectionRefusedError = 101, ProxyNotFoundError = 103, ProxyTimeoutError = 104, RemoteHostClosedError = 2, SslHandshakeFailedError = 6, TemporaryNetworkFailureError = 7, TimeoutError = 4, UnknownContentError = 299, UnknownNetworkError = 99, UnknownProxyError = 199 } |
More... | |
Public Types inherited from QtCore.QIODevice | |
enum | OpenModeFlag { Append = 4, NotOpen = 0, ReadOnly = 1, ReadWrite = 3, Text = 16, Truncate = 8, Unbuffered = 32, WriteOnly = 2 } |
More... | |
Public Member Functions | |
override void | CreateProxy () |
abstract void | Abort () |
| |
new object | Attribute (QNetworkRequest.Attribute code) |
| |
override void | Close () |
| |
new QNetworkReply.NetworkError | OnError () |
| |
new bool | HasRawHeader (QByteArray headerName) |
| |
new object | Header (QNetworkRequest.KnownHeaders header) |
| |
virtual void | IgnoreSslErrors () |
| |
new void | IgnoreSslErrors (System.Collections.Generic.List< QSslError > errors) |
| |
new bool | IsFinished () |
| |
new bool | IsRunning () |
| |
override bool | IsSequential () |
| |
new QNetworkAccessManager | Manager () |
| |
new QNetworkAccessManager.Operation | Operation () |
| |
new QByteArray | RawHeader (QByteArray headerName) |
| |
new System.Collections.Generic.List < QByteArray > | RawHeaderList () |
| |
new QNetworkRequest | Request () |
| |
new QUrl | Url () |
| |
new void | Dispose () |
Public Member Functions inherited from QtCore.QIODevice | |
QIODevice () | |
| |
QIODevice (QObject parent) | |
| |
virtual bool | AtEnd () |
| |
virtual long | BytesAvailable () |
| |
virtual long | BytesToWrite () |
| |
virtual bool | CanReadLine () |
| |
new string | ErrorString () |
| |
new bool | GetChar (Pointer< sbyte > c) |
| |
new bool | IsOpen () |
| |
new bool | IsReadable () |
| |
new bool | IsTextModeEnabled () |
| |
new bool | IsWritable () |
| |
virtual bool | Open (QIODevice.OpenModeFlag mode) |
| |
new QIODevice.OpenModeFlag | OpenMode () |
| |
new QByteArray | Peek (long maxlen) |
| |
new long | Peek (Pointer< sbyte > data, long maxlen) |
| |
virtual long | Pos () |
| |
new bool | PutChar (sbyte c) |
| |
new QByteArray | Read (long maxlen) |
| |
new long | Read (Pointer< sbyte > data, long maxlen) |
| |
new QByteArray | ReadAll () |
| |
new QByteArray | ReadLine (long maxlen=0) |
| |
new long | ReadLine (Pointer< sbyte > data, long maxlen) |
| |
virtual bool | Reset () |
| |
virtual bool | Seek (long pos) |
| |
new void | SetTextModeEnabled (bool enabled) |
| |
virtual long | Size () |
| |
new void | UngetChar (sbyte c) |
| |
virtual bool | WaitForBytesWritten (int msecs) |
| |
virtual bool | WaitForReadyRead (int msecs) |
| |
new long | Write (QByteArray data) |
| |
new long | Write (string data) |
| |
new long | Write (string data, long len) |
| |
new void | Dispose () |
Public Member Functions inherited from QtCore.QObject | |
QObject (QObject parent=null) | |
| |
new bool | BlockSignals (bool b) |
| |
new System.Collections.Generic.List < QObject > | Children () |
| |
new bool | Connect (QObject sender, string signal, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection) |
| |
new void | DeleteLater () |
| |
new bool | Disconnect (QObject receiver, string member=null) |
| |
new bool | Disconnect (string signal=null, QObject receiver=null, string member=null) |
| |
new void | DumpObjectInfo () |
| |
new void | DumpObjectTree () |
| |
new System.Collections.Generic.List < QByteArray > | DynamicPropertyNames () |
| |
virtual bool | OnEvent (QEvent arg1) |
| |
virtual bool | EventFilter (QObject arg1, QEvent arg2) |
| |
new bool | Inherits (string classname) |
| |
new void | InstallEventFilter (QObject arg1) |
| |
new bool | IsWidgetType () |
| |
new void | KillTimer (int id) |
| |
new object | Property (string name) |
| |
new void | RemoveEventFilter (QObject arg1) |
| |
new bool | SetProperty (string name, object value) |
| |
new void | SetUserData (uint id, QObjectUserData data) |
new bool | SignalsBlocked () |
| |
new int | StartTimer (int interval) |
| |
new QObjectUserData | UserData (uint id) |
new void | Dispose () |
Public Member Functions inherited from QtCore.Qt | |
delegate QTextStream | FuncQTextStreamQTextStream (QTextStream qTextStream) |
delegate string | FuncStringQByteArray (QByteArray qByteArray) |
delegate QByteArray | FuncQByteArrayString (string @string) |
delegate void | ActionQtMsgTypeString (QtMsgType qtMsgType, string @string) |
delegate QObject | FuncQObject () |
Static Public Member Functions | |
static string | Tr (string s, string c=null) |
static string | Tr (string s, string c, int n) |
static string | TrUtf8 (string s, string c=null) |
static string | TrUtf8 (string s, string c, int n) |
Static Public Member Functions inherited from QtCore.QIODevice | |
static string | Tr (string s, string c=null) |
static string | Tr (string s, string c, int n) |
static string | TrUtf8 (string s, string c=null) |
static string | TrUtf8 (string s, string c, int n) |
Static Public Member Functions inherited from QtCore.QObject | |
static bool | Connect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod method, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection) |
| |
static bool | Connect (QObject sender, string signal, QObject receiver, string member, Qt.ConnectionType arg5=Qt.ConnectionType.AutoConnection) |
| |
static bool | Disconnect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod member) |
| |
static bool | Disconnect (QObject sender, string signal, QObject receiver, string member) |
| |
static uint | RegisterUserData () |
static string | Tr (string s, string c=null) |
| |
static string | Tr (string s, string c, int n) |
| |
static string | TrUtf8 (string s, string c=null) |
| |
static string | TrUtf8 (string s, string c, int n) |
| |
Static Public Member Functions inherited from QtCore.Qt | |
static QDataStream | Write (QDataStream s, object p) |
static QDataStream | Write (QDataStream arg1, QSizeF arg2) |
static QTextStream | Write (QTextStream s, Qt.FuncQTextStreamQTextStream f) |
static QDataStream | Write (QDataStream arg1, QPoint arg2) |
static QDataStream | Write (QDataStream arg1, QLineF arg2) |
static QDataStream | Write (QDataStream arg1, QPointF arg2) |
static QDataStream | Write (QDataStream arg1, QChar arg2) |
static QDataStream | Write (QDataStream arg1, QByteArray arg2) |
static QDataStream | Write (QDataStream arg1, QEasingCurve arg2) |
static QDataStream | Write (QDataStream arg1, QRectF arg2) |
static QDataStream | Write (QDataStream arg1, QDateTime arg2) |
static QDataStream | Write (QDataStream arg1, QUrl arg2) |
static QDataStream | Write (QDataStream arg1, QTime arg2) |
static QDataStream | Write (QDataStream arg1, QLocale arg2) |
static QDataStream | Write (QDataStream arg1, QBitArray arg2) |
static QDataStream | Write (QDataStream arg1, QUuid arg2) |
static QDataStream | Write (QDataStream arg1, QLine arg2) |
static QDataStream | Write (QDataStream arg1, QDate arg2) |
static QDataStream | Write (QDataStream @out, QRegExp regExp) |
static QDataStream | Write (QDataStream arg1, QRect arg2) |
static QDataStream | Write (QDataStream arg1, QSize arg2) |
static QDataStream | Write (QDataStream s, QVariant.Type p) |
static QDataStream | Write (QDataStream arg1, string arg2) |
static QDataStream | Write (QDataStream @out, System.Collections.Generic.List< string > list) |
static QDataStream | Read (QDataStream arg1, QChar arg2) |
static QDataStream | Read (QDataStream arg1, QLocale arg2) |
static QDataStream | Read (QDataStream arg1, QRect arg2) |
static QDataStream | Read (QDataStream arg1, QEasingCurve arg2) |
static QDataStream | Read (QDataStream arg1, QDate arg2) |
static QDataStream | Read (QDataStream arg1, QUrl arg2) |
static QDataStream | Read (QDataStream arg1, QUuid arg2) |
static QTextStream | Read (QTextStream s, Qt.FuncQTextStreamQTextStream f) |
static QDataStream | Read (QDataStream arg1, QLineF arg2) |
static QDataStream | Read (QDataStream arg1, QRectF arg2) |
static QDataStream | Read (QDataStream arg1, QPointF arg2) |
static QDataStream | Read (QDataStream arg1, QLine arg2) |
static QDataStream | Read (QDataStream arg1, QBitArray arg2) |
static QDataStream | Read (QDataStream arg1, QSize arg2) |
static QDataStream | Read (QDataStream arg1, QDateTime arg2) |
static QDataStream | Read (QDataStream arg1, QTime arg2) |
static QDataStream | Read (QDataStream arg1, QPoint arg2) |
static QDataStream | Read (QDataStream @in, QRegExp regExp) |
static QDataStream | Read (QDataStream s, object p) |
static QDataStream | Read (QDataStream arg1, QByteArray arg2) |
static QDataStream | Read (QDataStream arg1, QSizeF arg2) |
static QDataStream | Read (QDataStream arg1, string arg2) |
static QDataStream | Read (QDataStream s, QVariant.Type p) |
static QDataStream | Read (QDataStream @in, System.Collections.Generic.List< string > list) |
static double | qAcos (double v) |
static void | qAddPostRoutine (System.Action arg1) |
static string | qAppName () |
static double | qAsin (double v) |
static double | qAtan (double v) |
static double | qAtan2 (double x, double y) |
static void | qBadAlloc () |
static int | qCeil (double v) |
static ushort | qChecksum (string s, uint len) |
static QByteArray | qCompress (QByteArray data) |
static QByteArray | qCompress (QByteArray data, int compressionLevel=-1) |
static QByteArray | qCompress (Pointer< byte > data, int nbytes) |
static QByteArray | qCompress (Pointer< byte > data, int nbytes, int compressionLevel=-1) |
static double | qCos (double v) |
static double | qExp (double v) |
static double | qFabs (double v) |
static double | qFastCos (double x) |
static double | qFastSin (double x) |
static string | qFlagLocation (string method) |
static int | qFloor (double v) |
static bool | qFuzzyCompare (double p1, double p2) |
static bool | qFuzzyCompare (float p1, float p2) |
static bool | qFuzzyIsNull (double d) |
static bool | qFuzzyIsNull (float f) |
static uint | qHash (QBitArray key) |
static uint | qHash (QChar key) |
static uint | qHash (QStringRef key) |
static uint | qHash (QUrl url) |
static uint | qHash (QPersistentModelIndex index) |
static uint | qHash (QByteArray key) |
static uint | qHash (QModelIndex index) |
static uint | qHash (uint key) |
static uint | qHash (sbyte key) |
static uint | qHash (byte key) |
static uint | qHash (short key) |
static uint | qHash (NativeLong key) |
static uint | qHash (ushort key) |
static uint | qHash (long key) |
static uint | qHash (ulong key) |
static uint | qHash (int key) |
static uint | qHash (string key) |
static uint | qHash (NativeULong key) |
static double | qInf () |
static Qt.ActionQtMsgTypeString | qInstallMsgHandler (Qt.ActionQtMsgTypeString arg1) |
static int | qIntCast (float f) |
static int | qIntCast (double f) |
static bool | qIsFinite (double d) |
static bool | qIsFinite (float f) |
static bool | qIsInf (float f) |
static bool | qIsInf (double d) |
static bool | qIsNaN (float f) |
static bool | qIsNaN (double d) |
static bool | qIsNull (float f) |
static bool | qIsNull (double d) |
static double | qLn (double v) |
static double | qPow (double x, double y) |
static double | qQNaN () |
static void | qRegisterStaticPluginInstanceFunction (Qt.FuncQObject function) |
static void | qRemovePostRoutine (System.Action arg1) |
static int | qRound (double d) |
static long | qRound64 (double d) |
static double | qSNaN () |
static bool | qSharedBuild () |
static double | qSin (double v) |
static double | qSqrt (double v) |
static bool | qStringComparisonHelper (QStringRef s1, string s2) |
static double | qTan (double v) |
static QByteArray | qUncompress (QByteArray data) |
static QByteArray | qUncompress (Pointer< byte > data, int nbytes) |
static string | qVersion () |
static void | Qbswap_helper (Pointer< byte > src, Pointer< byte > dest, int size) |
static QByteArray | Qgetenv (string varName) |
static bool | Qputenv (string varName, QByteArray value) |
static int | Qrand () |
static void | Qsrand (uint seed) |
static int | Qstrcmp (QByteArray str1, QByteArray str2) |
static int | Qstrcmp (QByteArray str1, string str2) |
static int | Qstrcmp (string str1, QByteArray str2) |
static int | Qstrcmp (string str1, string str2) |
static Pointer< sbyte > | Qstrcpy (Pointer< sbyte > dst, string src) |
static Pointer< sbyte > | Qstrdup (string arg1) |
static int | Qstricmp (string arg1, string arg2) |
static uint | Qstrlen (string str) |
static int | Qstrncmp (string str1, string str2, uint len) |
static Pointer< sbyte > | Qstrncpy (Pointer< sbyte > dst, string src, uint len) |
static int | Qstrnicmp (string arg1, string arg2, uint len) |
static uint | Qstrnlen (string str, uint maxlen) |
static string | QtTrId (string id, int n=-1) |
Protected Member Functions | |
QNetworkReply (System.Type dummy) | |
QNetworkReply (QObject parent=null) | |
| |
new void | OnDownloadProgress (long bytesReceived, long bytesTotal) |
| |
new void | OnError (QNetworkReply.NetworkError arg1) |
| |
new void | OnFinished () |
| |
new void | OnMetaDataChanged () |
| |
new void | SetAttribute (QNetworkRequest.Attribute code, object value) |
| |
new void | SetError (QNetworkReply.NetworkError errorCode, string errorString) |
| |
new void | SetFinished (bool arg1) |
| |
new void | SetHeader (QNetworkRequest.KnownHeaders header, object value) |
| |
new void | SetOperation (QNetworkAccessManager.Operation operation) |
| |
new void | SetRawHeader (QByteArray headerName, QByteArray value) |
| |
new void | SetRequest (QNetworkRequest request) |
| |
new void | SetUrl (QUrl url) |
| |
new void | OnSslErrors (System.Collections.Generic.List< QSslError > errors) |
| |
new void | OnUploadProgress (long bytesSent, long bytesTotal) |
| |
override long | WriteData (string data, long len) |
| |
Protected Member Functions inherited from QtCore.QIODevice | |
QIODevice (System.Type dummy) | |
new void | OnAboutToClose () |
| |
new void | OnBytesWritten (long bytes) |
| |
new void | OnReadChannelFinished () |
| |
abstract long | ReadData (Pointer< sbyte > data, long maxlen) |
| |
virtual long | ReadLineData (Pointer< sbyte > data, long maxlen) |
| |
new void | OnReadyRead () |
| |
new void | SetErrorString (string errorString) |
| |
new void | SetOpenMode (QIODevice.OpenModeFlag openMode) |
| |
Protected Member Functions inherited from QtCore.QObject | |
QObject (System.Type dummy) | |
virtual void | OnChildEvent (QChildEvent arg1) |
| |
virtual void | ConnectNotify (string signal) |
| |
virtual void | OnCustomEvent (QEvent arg1) |
| |
new void | OnDestroyed (QObject arg1=null) |
| |
virtual void | DisconnectNotify (string signal) |
| |
new int | Receivers (string signal) |
| |
new QObject | Sender () |
| |
new int | SenderSignalIndex () |
| |
virtual void | OnTimerEvent (QTimerEvent arg1) |
| |
Properties | |
Slot | MetaDataChanged |
| |
Slot | Finished |
| |
Slot< QNetworkReply.NetworkError > | Error |
| |
Slot < System.Collections.Generic.List < QSslError > > | SslErrors |
| |
Slot< System.Int64, System.Int64 > | UploadProgress |
| |
Slot< System.Int64, System.Int64 > | DownloadProgress |
| |
virtual long | ReadBufferSize [get, set] |
| |
new QSslConfiguration | SslConfiguration [get, set] |
| |
static new QMetaObject | StaticMetaObject [get] |
new IQNetworkReplySignals | Emit [get] |
Properties inherited from QtCore.QIODevice | |
Slot | ReadyRead |
| |
Slot< System.Int64 > | BytesWritten |
| |
Slot | AboutToClose |
| |
Slot | ReadChannelFinished |
| |
static new QMetaObject | StaticMetaObject [get] |
new IQIODeviceSignals | Emit [get] |
Properties inherited from QtCore.QObject | |
virtual EventHandler < QEventArgs< QChildEvent > > | ChildEvent |
| |
virtual EventHandler < QEventArgs< QEvent > > | CustomEvent |
| |
virtual EventHandler < QEventArgs< QEvent > > | Event |
| |
virtual EventHandler < QEventArgs< QTimerEvent > > | TimerEvent |
| |
Slot< QObject > | DestroyedQObject |
Slot | Destroyed |
| |
new QObject | Parent [get, set] |
| |
virtual System.IntPtr | SmokeObject [get, set] |
new string | ObjectName [get, set] |
| |
static new QMetaObject | StaticMetaObject [get] |
| |
static new QMetaObject | StaticQtMetaObject [get] |
new IQObjectSignals | Emit [get] |
Additional Inherited Members | |
Protected Attributes inherited from QtCore.QObject | |
object | Q_EMIT = null |
SmokeInvocation | interceptor |
readonly List< QEventHandler > | eventFilters = new List<QEventHandler>() |
The QNetworkReply class contains the data and headers for a request sent with QNetworkAccessManager
The QNetworkReply class contains the data and meta data related to a request posted with QNetworkAccessManager. Like QNetworkRequest, it contains a URL and headers (both in parsed and raw form), some information about the reply's state and the contents of the reply itself.
QNetworkReply is a sequential-access QIODevice, which means that once data is read from the object, it no longer kept by the device. It is therefore the application's responsibility to keep this data if it needs to. Whenever more data is received from the network and processed, the readyRead() signal is emitted.
The downloadProgress() signal is also emitted when data is received, but the number of bytes contained in it may not represent the actual bytes received, if any transformation is done to the contents (for example, decompressing and removing the protocol overhead).
Even though QNetworkReply is a QIODevice connected to the contents of the reply, it also emits the uploadProgress() signal, which indicates the progress of the upload for operations that have such content.
Note: Do not delete the object in the slot connected to the error() or finished() signal. Use deleteLater().
See also QNetworkRequest and QNetworkAccessManager.
Indicates all possible error conditions found during the processing of the request.
See also error().
|
protected |
|
protected |
Creates a QNetworkReply object with parent parent.
You cannot directly instantiate QNetworkReply objects. Use QNetworkAccessManager functions to do that.
|
pure virtual |
Aborts the operation immediately and close down any network connections still open. Uploads still in progress are also aborted.
See also close().
new object QtNetwork.QNetworkReply.Attribute | ( | QNetworkRequest.Attribute | code | ) |
Returns the attribute associated with the code code. If the attribute has not been set, it returns an invalid QVariant (type QVariant::Null).
You can expect the default values listed in QNetworkRequest::Attribute to be applied to the values returned by this function.
See also setAttribute() and QNetworkRequest::Attribute.
|
virtual |
Reimplemented from QIODevice::close().
Closes this device for reading. Unread data is discarded, but the network resources are not discarded until they are finished. In particular, if any upload is in progress, it will continue until it is done.
The finished() signal is emitted when all operations are over and the network resources are freed.
See also abort() and finished().
Reimplemented from QtCore.QIODevice.
|
virtual |
Reimplemented from QtCore.QIODevice.
new void QtNetwork.QNetworkReply.Dispose | ( | ) |
new bool QtNetwork.QNetworkReply.HasRawHeader | ( | QByteArray | headerName | ) |
Returns true if the raw header of name headerName was sent by the remote server
See also rawHeader().
new object QtNetwork.QNetworkReply.Header | ( | QNetworkRequest.KnownHeaders | header | ) |
Returns the value of the known header header, if that header was sent by the remote server. If the header was not sent, returns an invalid QVariant.
See also rawHeader(), setHeader(), and QNetworkRequest::header().
|
virtual |
If this function is called, SSL errors related to network connection will be ignored, including certificate validation errors.
Note that calling this function without restraint may pose a security risk for your application. Use it with care.
This function can be called from the slot connected to the sslErrors() signal, which indicates which errors were found.
See also sslConfiguration(), sslErrors(), and QSslSocket::ignoreSslErrors().
new void QtNetwork.QNetworkReply.IgnoreSslErrors | ( | System.Collections.Generic.List< QSslError > | errors | ) |
This is an overloaded function.
If this function is called, the SSL errors given in errors will be ignored.
Note that you can set the expected certificate in the SSL error: If, for instance, you want to issue a request to a server that uses a self-signed certificate, consider the following snippet:
QList<QSslCertificate> cert = QSslCertificate::fromPath(QLatin1String("server-certificate.pem"));
QSslError error(QSslError::SelfSignedCertificate, cert.at(0));
QList<QSslError> expectedSslErrors;
expectedSslErrors.append(error);
QNetworkReply *reply = manager.get(QNetworkRequest(QUrl("https://server.tld/index.html")));
reply->ignoreSslErrors(expectedSslErrors);
// here connect signals etc.
Multiple calls to this function will replace the list of errors that were passed in previous calls. You can clear the list of errors you want to ignore by calling this function with an empty list.
This function was introduced in Qt 4.6.
See also sslConfiguration(), sslErrors(), and QSslSocket::ignoreSslErrors().
new bool QtNetwork.QNetworkReply.IsFinished | ( | ) |
Returns true when the reply has finished or was aborted.
This function was introduced in Qt 4.6.
See also isRunning().
new bool QtNetwork.QNetworkReply.IsRunning | ( | ) |
Returns true when the request is still processing and the reply has not finished or was aborted yet.
This function was introduced in Qt 4.6.
See also isFinished().
|
virtual |
Returns true if this device is sequential; otherwise returns false.
Sequential devices, as opposed to a random-access devices, have no concept of a start, an end, a size, or a current position, and they do not support seeking. You can only read from the device when it reports that data is available. The most common example of a sequential device is a network socket. On Unix, special files such as /dev/zero and fifo pipes are sequential.
Regular files, on the other hand, do support random access. They have both a size and a current position, and they also support seeking backwards and forwards in the data stream. Regular files are non-sequential.
The QIODevice implementation returns false.
See also bytesAvailable().
Reimplemented from QtCore.QIODevice.
new QNetworkAccessManager QtNetwork.QNetworkReply.Manager | ( | ) |
Returns the QNetworkAccessManager that was used to create this QNetworkReply object. Initially, it is also the parent object.
|
protected |
This signal is emitted to indicate the progress of the download part of this network request, if there's any. If there's no download associated with this request, this signal will be emitted once with 0 as the value of both bytesReceived and bytesTotal.
The bytesReceived parameter indicates the number of bytes received, while bytesTotal indicates the total number of bytes expected to be downloaded. If the number of bytes to be downloaded is not known, bytesTotal will be -1.
The download is finished when bytesReceived is equal to bytesTotal. At that time, bytesTotal will not be -1.
Note that the values of both bytesReceived and bytesTotal may be different from size(), the total number of bytes obtained through read() or readAll(), or the value of the header(ContentLengthHeader). The reason for that is that there may be protocol overhead or the data may be compressed during the download.
See also uploadProgress() and bytesAvailable().
new QNetworkReply.NetworkError QtNetwork.QNetworkReply.OnError | ( | ) |
Returns the error that was found during the processing of this request. If no error was found, returns NoError.
See also setError().
|
protected |
Returns the error that was found during the processing of this request. If no error was found, returns NoError.
See also setError().
|
protected |
This signal is emitted when the reply has finished processing. After this signal is emitted, there will be no more updates to the reply's data or metadata.
Unless close() has been called, the reply will be still be opened for reading, so the data can be retrieved by calls to read() or readAll(). In particular, if no calls to read() were made as a result of readyRead(), a call to readAll() will retrieve the full contents in a QByteArray.
This signal is emitted in tandem with QNetworkAccessManager::finished() where that signal's reply parameter is this object.
Note: Do not delete the object in the slot connected to this signal. Use deleteLater().
You can also use isFinished() to check if a QNetworkReply has finished even before you receive the finished() signal.
See also setFinished(), QNetworkAccessManager::finished(), and isFinished().
|
protected |
This signal is emitted whenever the metadata in this reply changes. metadata is any information that is not the content (data) itself, including the network headers. In the majority of cases, the metadata will be known fully by the time the first byte of data is received. However, it is possible to receive updates of headers or other metadata during the processing of the data.
See also header(), rawHeaderList(), rawHeader(), and hasRawHeader().
|
protected |
This signal is emitted if the SSL/TLS session encountered errors during the set up, including certificate verification errors. The errors parameter contains the list of errors.
To indicate that the errors are not fatal and that the connection should proceed, the ignoreSslErrors() function should be called from the slot connected to this signal. If it is not called, the SSL session will be torn down before any data is exchanged (including the URL).
This signal can be used to display an error message to the user indicating that security may be compromised and display the SSL settings (see sslConfiguration() to obtain it). If the user decides to proceed after analyzing the remote certificate, the slot should call ignoreSslErrors().
See also QSslSocket::sslErrors(), QNetworkAccessManager::sslErrors(), sslConfiguration(), and ignoreSslErrors().
|
protected |
This signal is emitted to indicate the progress of the upload part of this network request, if there's any. If there's no upload associated with this request, this signal will not be emitted.
The bytesSent parameter indicates the number of bytes uploaded, while bytesTotal indicates the total number of bytes to be uploaded. If the number of bytes to be uploaded could not be determined, bytesTotal will be -1.
The upload is finished when bytesSent is equal to bytesTotal. At that time, bytesTotal will not be -1.
See also downloadProgress().
new QNetworkAccessManager.Operation QtNetwork.QNetworkReply.Operation | ( | ) |
Returns the operation that was posted for this reply.
See also setOperation().
new QByteArray QtNetwork.QNetworkReply.RawHeader | ( | QByteArray | headerName | ) |
Returns the raw contents of the header headerName as sent by the remote server. If there is no such header, returns an empty byte array, which may be indistinguishable from an empty header. Use hasRawHeader() to verify if the server sent such header field.
See also setRawHeader(), hasRawHeader(), and header().
new System.Collections.Generic.List<QByteArray> QtNetwork.QNetworkReply.RawHeaderList | ( | ) |
Returns a list of headers fields that were sent by the remote server, in the order that they were sent. Duplicate headers are merged together and take place of the latter duplicate.
new QNetworkRequest QtNetwork.QNetworkReply.Request | ( | ) |
Returns the request that was posted for this reply. In special, note that the URL for the request may be different than that of the reply.
See also QNetworkRequest::url(), url(), and setRequest().
|
protected |
Sets the attribute code to have value value. If code was previously set, it will be overridden. If value is an invalid QVariant, the attribute will be unset.
See also attribute() and QNetworkRequest::setAttribute().
|
protected |
Sets the error condition to be errorCode. The human-readable message is set with errorString.
Calling setError() does not emit the error(QNetworkReply::NetworkError) signal.
See also error() and errorString().
|
protected |
Sets the reply as finished.
After having this set the replies data must not change.
This function was introduced in Qt 4.8.
See also finished() and isFinished().
|
protected |
Sets the known header header to be of value value. The corresponding raw form of the header will be set as well.
See also header(), setRawHeader(), and QNetworkRequest::setHeader().
|
protected |
Sets the associated operation for this object to be operation. This value will be returned by operation().
Note: the operation should be set when this object is created and not changed again.
See also operation() and setRequest().
|
protected |
Sets the raw header headerName to be of value value. If headerName was previously set, it is overridden. Multiple HTTP headers of the same name are functionally equivalent to one single header with the values concatenated, separated by commas.
If headerName matches a known header, the value value will be parsed and the corresponding parsed form will also be set.
See also rawHeader(), header(), setHeader(), and QNetworkRequest::setRawHeader().
|
protected |
Sets the associated request for this object to be request. This value will be returned by request().
Note: the request should be set when this object is created and not changed again.
See also request() and setOperation().
|
protected |
Sets the URL being processed to be url. Normally, the URL matches that of the request that was posted, but for a variety of reasons it can be different (for example, a file path being made absolute or canonical).
See also url(), request(), and QNetworkRequest::url().
|
static |
|
static |
|
static |
|
static |
new QUrl QtNetwork.QNetworkReply.Url | ( | ) |
Returns the URL of the content downloaded or uploaded. Note that the URL may be different from that of the original request.
See also request(), setUrl(), and QNetworkRequest::url().
|
protectedvirtual |
Writes up to maxSize bytes from data to the device. Returns the number of bytes written, or -1 if an error occurred.
This function is called by QIODevice. Reimplement this function when creating a subclass of QIODevice.
When reimplementing this function it is important that this function writes all the data available before returning. This is required in order for QDataStream to be able to operate on the class. QDataStream assumes all the information was written and therefore does not retry writing if there was a problem.
See also read() and write().
Implements QtCore.QIODevice.
|
addremove |
This signal is emitted to indicate the progress of the download part of this network request, if there's any. If there's no download associated with this request, this signal will be emitted once with 0 as the value of both bytesReceived and bytesTotal.
The bytesReceived parameter indicates the number of bytes received, while bytesTotal indicates the total number of bytes expected to be downloaded. If the number of bytes to be downloaded is not known, bytesTotal will be -1.
The download is finished when bytesReceived is equal to bytesTotal. At that time, bytesTotal will not be -1.
Note that the values of both bytesReceived and bytesTotal may be different from size(), the total number of bytes obtained through read() or readAll(), or the value of the header(ContentLengthHeader). The reason for that is that there may be protocol overhead or the data may be compressed during the download.
See also uploadProgress() and bytesAvailable().
|
getprotected |
|
addremove |
Returns the error that was found during the processing of this request. If no error was found, returns NoError.
See also setError().
|
addremove |
This signal is emitted when the reply has finished processing. After this signal is emitted, there will be no more updates to the reply's data or metadata.
Unless close() has been called, the reply will be still be opened for reading, so the data can be retrieved by calls to read() or readAll(). In particular, if no calls to read() were made as a result of readyRead(), a call to readAll() will retrieve the full contents in a QByteArray.
This signal is emitted in tandem with QNetworkAccessManager::finished() where that signal's reply parameter is this object.
Note: Do not delete the object in the slot connected to this signal. Use deleteLater().
You can also use isFinished() to check if a QNetworkReply has finished even before you receive the finished() signal.
See also setFinished(), QNetworkAccessManager::finished(), and isFinished().
|
addremove |
This signal is emitted whenever the metadata in this reply changes. metadata is any information that is not the content (data) itself, including the network headers. In the majority of cases, the metadata will be known fully by the time the first byte of data is received. However, it is possible to receive updates of headers or other metadata during the processing of the data.
See also header(), rawHeaderList(), rawHeader(), and hasRawHeader().
|
getset |
Returns the size of the read buffer, in bytes.
Sets the size of the read buffer to be size bytes. The read buffer is the buffer that holds data that is being downloaded off the network, before it is read with QIODevice::read(). Setting the buffer size to 0 will make the buffer unlimited in size.
QNetworkReply will try to stop reading from the network once this buffer is full (i.e., bytesAvailable() returns size or more), thus causing the download to throttle down as well. If the buffer is not limited in size, QNetworkReply will try to download as fast as possible from the network.
Unlike QAbstractSocket::setReadBufferSize(), QNetworkReply cannot guarantee precision in the read buffer size. That is, bytesAvailable() can return more than size.
|
getset |
Returns the SSL configuration and state associated with this reply, if SSL was used. It will contain the remote server's certificate, its certificate chain leading to the Certificate Authority as well as the encryption ciphers in use.
The peer's certificate and its certificate chain will be known by the time sslErrors() is emitted, if it's emitted.
Sets the SSL configuration for the network connection associated with this request, if possible, to be that of config.
|
addremove |
This signal is emitted if the SSL/TLS session encountered errors during the set up, including certificate verification errors. The errors parameter contains the list of errors.
To indicate that the errors are not fatal and that the connection should proceed, the ignoreSslErrors() function should be called from the slot connected to this signal. If it is not called, the SSL session will be torn down before any data is exchanged (including the URL).
This signal can be used to display an error message to the user indicating that security may be compromised and display the SSL settings (see sslConfiguration() to obtain it). If the user decides to proceed after analyzing the remote certificate, the slot should call ignoreSslErrors().
See also QSslSocket::sslErrors(), QNetworkAccessManager::sslErrors(), sslConfiguration(), and ignoreSslErrors().
|
staticget |
|
addremove |
This signal is emitted to indicate the progress of the upload part of this network request, if there's any. If there's no upload associated with this request, this signal will not be emitted.
The bytesSent parameter indicates the number of bytes uploaded, while bytesTotal indicates the total number of bytes to be uploaded. If the number of bytes to be uploaded could not be determined, bytesTotal will be -1.
The upload is finished when bytesSent is equal to bytesTotal. At that time, bytesTotal will not be -1.
See also downloadProgress().