- class QNetworkCacheMetaData¶
The
QNetworkCacheMetaData
class provides cache information. More…Synopsis¶
Methods¶
def
__init__()
def
attributes()
def
expirationDate()
def
headers()
def
isValid()
def
lastModified()
def
__ne__()
def
__eq__()
def
rawHeaders()
def
saveToDisk()
def
setAttributes()
def
setHeaders()
def
setRawHeaders()
def
setSaveToDisk()
def
setUrl()
def
swap()
def
url()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
QNetworkCacheMetaData
provides information about a cache file including the url, when it was last modified, when the cache file was created, headers for file and if the file should be saved onto a disk.See also
- __init__()¶
Constructs an invalid network cache meta data.
See also
- __init__(other)
- Parameters:
other –
QNetworkCacheMetaData
Constructs a copy of the
other
QNetworkCacheMetaData
.- attributes()¶
- Return type:
Dictionary with keys of type .QNetworkRequest.Attribute and values of type QVariant.
Returns all the attributes stored with this cache item.
See also
Returns the date and time when the meta data expires.
See also
- headers()¶
- Return type:
Returns headers in form of
QHttpHeaders
that are set in this meta data.See also
- isValid()¶
- Return type:
bool
Returns
true
if this network cache meta data has attributes that have been set otherwise false.Returns the date and time when the meta data was last modified.
See also
- __ne__(other)¶
- Parameters:
other –
QNetworkCacheMetaData
- Return type:
bool
Returns
true
if this meta data is not equal to theother
meta data; otherwise returnsfalse
.See also
operator==()
- __eq__(other)¶
- Parameters:
other –
QNetworkCacheMetaData
- Return type:
bool
Returns
true
if this meta data is equal to theother
meta data; otherwise returnsfalse
.See also
operator!=()
- rawHeaders()¶
- Return type:
.list of std.pairQByteArray,QByteArray
Returns a list of all raw headers that are set in this meta data. The list is in the same order that the headers were set.
See also
- saveToDisk()¶
- Return type:
bool
Returns is this cache should be allowed to be stored on disk.
Some cache implementations can keep these cache items in memory for performance reasons, but for security reasons they should not be written to disk.
Specifically with http, documents with Cache-control set to no-store or any https document that doesn’t have “Cache-control: public” set will set the saveToDisk to false.
See also
- setAttributes(attributes)¶
- Parameters:
attributes – Dictionary with keys of type .QNetworkRequest.Attribute and values of type QVariant.
Sets all attributes of this cache item to be the map
attributes
.See also
Sets the date and time when the meta data expires to
dateTime
.See also
- setHeaders(headers)¶
- Parameters:
headers –
QHttpHeaders
Sets the headers of this network cache meta data to
headers
.See also
Sets the date and time when the meta data was last modified to
dateTime
.See also
- setRawHeaders(headers)¶
- Parameters:
headers – .list of std.pairQByteArray,QByteArray
Sets the raw headers to
list
.See also
- setSaveToDisk(allow)¶
- Parameters:
allow – bool
Sets whether this network cache meta data and associated content should be allowed to be stored on disk to
allow
.See also
Sets the URL this network cache meta data to be
url
.The password and fragment are removed from the url.
See also
- swap(other)¶
- Parameters:
other –
QNetworkCacheMetaData
Swaps this metadata instance with
other
. This function is very fast and never fails.Returns the URL this network cache meta data is referring to.
See also