Class: QgsNetworkReplyContent¶
-
class
qgis.core.
QgsNetworkReplyContent
¶ Bases:
sip.wrapper
Default constructor for an empty reply.
QgsNetworkReplyContent(reply: QNetworkReply) Constructor for QgsNetworkReplyContent, populated from the specified
reply
.QgsNetworkReplyContent(QgsNetworkReplyContent)
Encapsulates a network reply within a container which is inexpensive to copy and safe to pass between threads.
New in version 3.6: Enums
Methods
Returns the attribute associated with the
code
.Clears the reply, resetting it back to a default, empty reply.
Returns the reply content.
Returns the reply’s error message, or QNetworkReply.NoError if no error was encountered.
Returns the error text for the reply, or an empty string if no error was encountered.
Returns
True
if the reply contains a header with the specifiedheaderName
.Returns the content of the header with the specified
headerName
, or an empty QByteArray if the specified header was not found in the reply.Returns a list of raw header names contained within the reply.
Returns the original network request.
Returns the unique ID identifying the original request which this response was formed from.
Sets the reply content.
Signals
Attributes
-
attribute
(self, code: QNetworkRequest.Attribute) → Any¶ Returns the attribute associated with the
code
. If the attribute has not been set, it returns an invalid QVariant.You can expect the default values listed in QNetworkRequest.Attribute to be applied to the values returned by this function.
See also
attributes()
-
clear
(self)¶ Clears the reply, resetting it back to a default, empty reply.
-
content
(self) → QByteArray¶ Returns the reply content. This is not available by default, as reading network reply content can only be done once.
Blocking network requests (see
QgsBlockingNetworkRequest
) will automatically populate this content.See also
-
error
(self) → QNetworkReply.NetworkError¶ Returns the reply’s error message, or QNetworkReply.NoError if no error was encountered.
See also
-
errorString
(self) → str¶ Returns the error text for the reply, or an empty string if no error was encountered.
See also
-
hasRawHeader
(self, headerName: Union[QByteArray, bytes, bytearray]) → bool¶ Returns
True
if the reply contains a header with the specifiedheaderName
.See also
rawHeaderPairs()
See also
See also
-
rawHeader
(self, headerName: Union[QByteArray, bytes, bytearray]) → QByteArray¶ Returns the content of the header with the specified
headerName
, or an empty QByteArray if the specified header was not found in the reply.See also
rawHeaderPairs()
See also
See also
-
rawHeaderList
(self) → List[QByteArray]¶ Returns a list of raw header names contained within the reply.
See also
rawHeaderPairs()
See also
See also
-
request
(self) → QNetworkRequest¶ Returns the original network request.
-
requestId
(self) → int¶ Returns the unique ID identifying the original request which this response was formed from.
-