Skip to content

PythonQt.QtNetwork.QNetworkReply · declarations 002

Back to PythonQt.QtNetwork.QNetworkReply

header

header(header: Any) -> Any

X.header(header) -> object

Supplemental documentation: Qt 5 reference:

QVariant QNetworkReply::header(QNetworkRequest::KnownHeaders header) const

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().

Upstream PySide2 reference signatures (binding differences may apply):

header(self, header: PySide2.QtNetwork.QNetworkRequest.KnownHeaders) -> typing.Any

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#header

ignoreSslErrors

ignoreSslErrors() -> None

X.ignoreSslErrors()

Supplemental documentation: Qt 5 reference:

[virtual slot] void QNetworkReply::ignoreSslErrors()

If this function is called, SSL errors related to network connection will be ignored, including certificate validation errors.

Warning: Be sure to always let the user inspect the errors reported by the sslErrors() signal, and only call this method upon confirmation from the user that proceeding is ok. If there are unexpected errors, the reply should be aborted. Calling this method without inspecting the actual errors will most likely pose a security risk for your application. Use it with great care!

This function can be called from the slot connected to the sslErrors() signal, which indicates which errors were found.

Note: If HTTP Strict Transport Security is enabled for QNetworkAccessManager, this function has no effect.

See also sslConfiguration(), sslErrors(), and QSslSocket::ignoreSslErrors().

void QNetworkReply::ignoreSslErrors(const QList\<QSslError> \&errors)

This is an overloaded function.

If this function is called, the SSL errors given in errors will be ignored.

Note: Because most SSL errors are associated with a certificate, for most of them you must set the expected certificate this SSL error is related to. 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.

Note: If HTTP Strict Transport Security is enabled for QNetworkAccessManager, this function has no effect.

This function was introduced in Qt 4.6.

See also sslConfiguration(), sslErrors(), QSslSocket::ignoreSslErrors(), and QNetworkAccessManager::setStrictTransportSecurityEnabled().

Upstream PySide2 reference signatures (binding differences may apply):

ignoreSslErrors(self) -> None
ignoreSslErrors(self, errors: typing.Sequence[PySide2.QtNetwork.QSslError]) -> None

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#ignoreSslErrors

ignoreSslErrorsImplementation

ignoreSslErrorsImplementation(arg__1: Any) -> None

X.ignoreSslErrorsImplementation(arg__1)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QNetworkReply::ignoreSslErrorsImplementation(const QList\<QSslError> \&errors)

This virtual method is provided to enable overriding the behavior of ignoreSslErrors(). ignoreSslErrors() is a public wrapper for this method. errors contains the errors the user wishes ignored.

This function was introduced in Qt 5.0.

See also ignoreSslErrors().

Upstream PySide2 reference signatures (binding differences may apply):

ignoreSslErrorsImplementation(self, arg__1: typing.Sequence[PySide2.QtNetwork.QSslError]) -> None

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#ignoreSslErrorsImplementation

isFinished

isFinished() -> bool

X.isFinished() -> bool

Supplemental documentation: Qt 5 reference:

bool QNetworkReply::isFinished() const

Returns true when the reply has finished or was aborted.

This function was introduced in Qt 4.6.

See also isRunning().

Upstream PySide2 reference signatures (binding differences may apply):

isFinished(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#isFinished

isRunning

isRunning() -> bool

X.isRunning() -> bool

Supplemental documentation: Qt 5 reference:

bool QNetworkReply::isRunning() const

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().

Upstream PySide2 reference signatures (binding differences may apply):

isRunning(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#isRunning

isSequential

isSequential() -> bool

X.isSequential() -> bool

Upstream PySide2 reference signatures (binding differences may apply):

isSequential(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#isSequential

manager

manager() -> Any

X.manager() -> PythonQt.QtNetwork.QNetworkAccessManager

Supplemental documentation: Qt 5 reference:

QNetworkAccessManager *QNetworkReply::manager() const

Returns the QNetworkAccessManager that was used to create this QNetworkReply object. Initially, it is also the parent object.

Upstream PySide2 reference signatures (binding differences may apply):

manager(self) -> PySide2.QtNetwork.QNetworkAccessManager

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#manager

metaDataChanged

metaDataChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtNetwork.QNetworkReply.metaDataChanged; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QNetworkReply::metaDataChanged()

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().

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#metaDataChanged

objectNameChanged

objectNameChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtNetwork.QNetworkReply.objectNameChanged; argument details are not documented.

operation

operation() -> Any

X.operation()

Supplemental documentation: Qt 5 reference:

QNetworkAccessManager::Operation QNetworkReply::operation() const

Returns the operation that was posted for this reply.

See also setOperation().

Upstream PySide2 reference signatures (binding differences may apply):

operation(self) -> PySide2.QtNetwork.QNetworkAccessManager.Operation

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#operation

preSharedKeyAuthenticationRequired

preSharedKeyAuthenticationRequired(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtNetwork.QNetworkReply.preSharedKeyAuthenticationRequired; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QNetworkReply::preSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator *authenticator)

This signal is emitted if the SSL/TLS handshake negotiates a PSK ciphersuite, and therefore a PSK authentication is then required.

When using PSK, the client must send to the server a valid identity and a valid pre shared key, in order for the SSL handshake to continue. Applications can provide this information in a slot connected to this signal, by filling in the passed authenticator object according to their needs.

Note: Ignoring this signal, or failing to provide the required credentials, will cause the handshake to fail, and therefore the connection to be aborted.

Note: The authenticator object is owned by the reply and must not be deleted by the application.

This function was introduced in Qt 5.5.

See also QSslPreSharedKeyAuthenticator.

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#preSharedKeyAuthenticationRequired

rawHeader

rawHeader(headerName: Any) -> Any

X.rawHeader(headerName) -> PythonQt.QtCore.QByteArray

Supplemental documentation: Qt 5 reference:

QByteArray QNetworkReply::rawHeader(const QByteArray \&headerName) const

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().

Upstream PySide2 reference signatures (binding differences may apply):

rawHeader(self, headerName: PySide2.QtCore.QByteArray) -> PySide2.QtCore.QByteArray

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#rawHeader

rawHeaderList

rawHeaderList() -> Any

X.rawHeaderList()

Supplemental documentation: Qt 5 reference:

QList\<QByteArray> QNetworkReply::rawHeaderList() const

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.

Upstream PySide2 reference signatures (binding differences may apply):

rawHeaderList(self) -> typing.List[PySide2.QtCore.QByteArray]

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#rawHeaderList

rawHeaderPairs

rawHeaderPairs() -> tuple

X.rawHeaderPairs() -> tuple

Supplemental documentation: Qt 5 reference:

const QList\<QNetworkReply::RawHeaderPair> \&QNetworkReply::rawHeaderPairs() const

Returns a list of raw header pairs.

Upstream PySide2 reference signatures (binding differences may apply):

rawHeaderPairs(self) -> typing.List[typing.Tuple[PySide2.QtCore.QByteArray, PySide2.QtCore.QByteArray]]

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#rawHeaderPairs

readBufferSize

readBufferSize() -> int

X.readBufferSize() -> int

Supplemental documentation: Qt 5 reference:

qint64 QNetworkReply::readBufferSize() const

Returns the size of the read buffer, in bytes.

See also setReadBufferSize().

Upstream PySide2 reference signatures (binding differences may apply):

readBufferSize(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#readBufferSize

readChannelFinished

readChannelFinished(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtNetwork.QNetworkReply.readChannelFinished; argument details are not documented.

readyRead

readyRead(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtNetwork.QNetworkReply.readyRead; argument details are not documented.

redirectAllowed

redirectAllowed(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtNetwork.QNetworkReply.redirectAllowed; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QNetworkReply::redirectAllowed()

When client code handling the redirected() signal has verified the new URL, it emits this signal to allow the redirect to go ahead. This protocol applies to network requests whose redirects policy is set to QNetworkRequest::UserVerifiedRedirectPolicy

This function was introduced in Qt 5.9.

See also QNetworkRequest::UserVerifiedRedirectPolicy, QNetworkAccessManager::setRedirectPolicy(), and QNetworkRequest::RedirectPolicyAttribute.

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#redirectAllowed

redirected

redirected(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtNetwork.QNetworkReply.redirected; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QNetworkReply::redirected(const QUrl \&url)

This signal is emitted if the QNetworkRequest::FollowRedirectsAttribute was set in the request and the server responded with a 3xx status (specifically 301, 302, 303, 305, 307 or 308 status code) with a valid url in the location header, indicating a HTTP redirect. The url parameter contains the new redirect url as returned by the server in the location header.

This function was introduced in Qt 5.6.

See also QNetworkRequest::FollowRedirectsAttribute.

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#redirected

request

request() -> Any

X.request() -> PythonQt.QtNetwork.QNetworkRequest

Supplemental documentation: Qt 5 reference:

QNetworkRequest QNetworkReply::request() const

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().

Upstream PySide2 reference signatures (binding differences may apply):

request(self) -> PySide2.QtNetwork.QNetworkRequest

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#request

setAttribute

setAttribute(code: Any, value: Any) -> None

X.setAttribute(code, value)

Supplemental documentation: Qt 5 reference:

[protected] void QNetworkReply::setAttribute(QNetworkRequest::Attribute code, const QVariant \&value)

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().

Upstream PySide2 reference signatures (binding differences may apply):

setAttribute(self, code: PySide2.QtNetwork.QNetworkRequest.Attribute, value: typing.Any) -> None

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#setAttribute

setError

setError(errorCode: Any, errorString: str) -> None

X.setError(errorCode, errorString)

Supplemental documentation: Qt 5 reference:

[protected] void QNetworkReply::setError(QNetworkReply::NetworkError errorCode, const QString \&errorString)

Sets the error condition to be errorCode. The human-readable message is set with errorString.

Calling setError() does not emit the errorOccurred(QNetworkReply::NetworkError) signal.

See also error() and errorString().

Upstream PySide2 reference signatures (binding differences may apply):

setError(self, errorCode: PySide2.QtNetwork.QNetworkReply.NetworkError, errorString: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#setError

setFinished

setFinished(arg__1: bool) -> None

X.setFinished(arg__1)

Supplemental documentation: Qt 5 reference:

[protected] void QNetworkReply::setFinished(bool finished)

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().

Upstream PySide2 reference signatures (binding differences may apply):

setFinished(self, arg__1: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#setFinished

setHeader

setHeader(header: Any, value: Any) -> None

X.setHeader(header, value)

Supplemental documentation: Qt 5 reference:

[protected] void QNetworkReply::setHeader(QNetworkRequest::KnownHeaders header, const QVariant \&value)

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().

Upstream PySide2 reference signatures (binding differences may apply):

setHeader(self, header: PySide2.QtNetwork.QNetworkRequest.KnownHeaders, value: typing.Any) -> None

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#setHeader

setOperation

setOperation(operation: Any) -> None

X.setOperation(operation)

Supplemental documentation: Qt 5 reference:

[protected] void QNetworkReply::setOperation(QNetworkAccessManager::Operation operation)

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().

Upstream PySide2 reference signatures (binding differences may apply):

setOperation(self, operation: PySide2.QtNetwork.QNetworkAccessManager.Operation) -> None

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#setOperation

setRawHeader

setRawHeader(headerName: Any, value: Any) -> None

X.setRawHeader(headerName, value)

Supplemental documentation: Qt 5 reference:

[protected] void QNetworkReply::setRawHeader(const QByteArray \&headerName, const QByteArray \&value)

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().

Upstream PySide2 reference signatures (binding differences may apply):

setRawHeader(self, headerName: PySide2.QtCore.QByteArray, value: PySide2.QtCore.QByteArray) -> None

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#setRawHeader

setReadBufferSize

setReadBufferSize(size: int) -> None

X.setReadBufferSize(size)

Supplemental documentation: Qt 5 reference:

[virtual] void QNetworkReply::setReadBufferSize(qint64 size)

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.

See also readBufferSize().

Upstream PySide2 reference signatures (binding differences may apply):

setReadBufferSize(self, size: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#setReadBufferSize

setRequest

setRequest(request: Any) -> None

X.setRequest(request)

Supplemental documentation: Qt 5 reference:

[protected] void QNetworkReply::setRequest(const QNetworkRequest \&request)

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().

Upstream PySide2 reference signatures (binding differences may apply):

setRequest(self, request: PySide2.QtNetwork.QNetworkRequest) -> None

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#setRequest

setSslConfigurationImplementation

setSslConfigurationImplementation(arg__1: Any) -> None

X.setSslConfigurationImplementation(arg__1)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QNetworkReply::setSslConfigurationImplementation(const QSslConfiguration \&configuration)

This virtual method is provided to enable overriding the behavior of setSslConfiguration(). setSslConfiguration() is a public wrapper for this method. If you override this method use configuration to set the SSL configuration.

This function was introduced in Qt 5.0.

See also sslConfigurationImplementation() and setSslConfiguration().

Upstream PySide2 reference signatures (binding differences may apply):

setSslConfigurationImplementation(self, arg__1: PySide2.QtNetwork.QSslConfiguration) -> None

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#setSslConfigurationImplementation

setUrl

setUrl(url: Any) -> None

X.setUrl(url)

Supplemental documentation: Qt 5 reference:

[protected] void QNetworkReply::setUrl(const QUrl \&url)

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().

Upstream PySide2 reference signatures (binding differences may apply):

setUrl(self, url: PySide2.QtCore.QUrl) -> None

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#setUrl

sslConfigurationImplementation

sslConfigurationImplementation(arg__1: Any) -> None

X.sslConfigurationImplementation(arg__1)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QNetworkReply::sslConfigurationImplementation(QSslConfiguration \&configuration) const

This virtual method is provided to enable overriding the behavior of sslConfiguration(). sslConfiguration() is a public wrapper for this method. The configuration will be returned in configuration.

This function was introduced in Qt 5.0.

See also setSslConfigurationImplementation() and sslConfiguration().

Upstream PySide2 reference signatures (binding differences may apply):

sslConfigurationImplementation(self, arg__1: PySide2.QtNetwork.QSslConfiguration) -> None

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#sslConfigurationImplementation

sslErrors

sslErrors(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtNetwork.QNetworkReply.sslErrors; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QNetworkReply::sslErrors(const QList\<QSslError> \&errors)

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().

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#sslErrors

uploadProgress

uploadProgress(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtNetwork.QNetworkReply.uploadProgress; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QNetworkReply::uploadProgress(qint64 bytesSent, qint64 bytesTotal)

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().

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#uploadProgress

url

url() -> Any

X.url() -> PythonQt.QtCore.QUrl

Supplemental documentation: Qt 5 reference:

QUrl QNetworkReply::url() const

Returns the URL of the content downloaded or uploaded. Note that the URL may be different from that of the original request. If the QNetworkRequest::FollowRedirectsAttribute was set in the request, then this function returns the current url that the network API is accessing, i.e the url emitted in the QNetworkReply::redirected signal.

See also request(), setUrl(), QNetworkRequest::url(), and redirected().

Upstream PySide2 reference signatures (binding differences may apply):

url(self) -> PySide2.QtCore.QUrl

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#url

writeData

writeData(data: str, len: int) -> int

X.writeData(data, len) -> int

Upstream PySide2 reference signatures (binding differences may apply):

writeData(self, data: str, len: int) -> int

Source: https://doc.qt.io/archives/qt-5.15/qnetworkreply.html#writeData