Skip to content

PythonQt.QtNetwork.QNetworkAccessManager · declarations 002

Back to PythonQt.QtNetwork.QNetworkAccessManager

setCookieJar

setCookieJar(cookieJar: Any) -> None

X.setCookieJar(cookieJar)

Supplemental documentation: Qt 5 reference:

void QNetworkAccessManager::setCookieJar(QNetworkCookieJar *cookieJar)

Sets the manager's cookie jar to be the cookieJar specified. The cookie jar is used by all requests dispatched by the manager.

Use this function to set the cookie jar object to a class that implements additional features, like saving the cookies to permanent storage.

Note: QNetworkAccessManager takes ownership of the cookieJar object.

If cookieJar is in the same thread as this QNetworkAccessManager, it will set the parent of the cookieJar so that the cookie jar is deleted when this object is deleted as well. If you want to share cookie jars between different QNetworkAccessManager objects, you may want to set the cookie jar's parent to 0 after calling this function.

QNetworkAccessManager by default does not implement any cookie policy of its own: it accepts all cookies sent by the server, as long as they are well formed and meet the minimum security requirements (cookie domain matches the request's and cookie path matches the request's). In order to implement your own security policy, override the QNetworkCookieJar::cookiesForUrl() and QNetworkCookieJar::setCookiesFromUrl() virtual functions. Those functions are called by QNetworkAccessManager when it detects a new cookie.

See also cookieJar(), QNetworkCookieJar::cookiesForUrl(), and QNetworkCookieJar::setCookiesFromUrl().

Upstream PySide2 reference signatures (binding differences may apply):

setCookieJar(self, cookieJar: PySide2.QtNetwork.QNetworkCookieJar) -> None

Source: https://doc.qt.io/archives/qt-5.15/qnetworkaccessmanager.html#setCookieJar

setNetworkAccessible

setNetworkAccessible(accessible: Any) -> None

X.setNetworkAccessible(accessible)

Upstream PySide2 reference signatures (binding differences may apply):

setNetworkAccessible(self, accessible: PySide2.QtNetwork.QNetworkAccessManager.NetworkAccessibility) -> None

Source: https://doc.qt.io/archives/qt-5.15/qnetworkaccessmanager.html#setNetworkAccessible

setProxy

setProxy(proxy: Any) -> None

X.setProxy(proxy)

Supplemental documentation: Qt 5 reference:

void QNetworkAccessManager::setProxy(const QNetworkProxy \&proxy)

Sets the proxy to be used in future requests to be proxy. This does not affect requests that have already been sent. The proxyAuthenticationRequired() signal will be emitted if the proxy requests authentication.

A proxy set with this function will be used for all requests issued by QNetworkAccessManager. In some cases, it might be necessary to select different proxies depending on the type of request being sent or the destination host. If that's the case, you should consider using setProxyFactory().

See also proxy() and proxyAuthenticationRequired().

Upstream PySide2 reference signatures (binding differences may apply):

setProxy(self, proxy: PySide2.QtNetwork.QNetworkProxy) -> None

Source: https://doc.qt.io/archives/qt-5.15/qnetworkaccessmanager.html#setProxy

setProxyFactory

setProxyFactory(factory: Any) -> None

X.setProxyFactory(factory)

Supplemental documentation: Qt 5 reference:

void QNetworkAccessManager::setProxyFactory(QNetworkProxyFactory *factory)

Sets the proxy factory for this class to be factory. A proxy factory is used to determine a more specific list of proxies to be used for a given request, instead of trying to use the same proxy value for all requests.

All queries sent by QNetworkAccessManager will have type QNetworkProxyQuery::UrlRequest.

For example, a proxy factory could apply the following rules:

  • if the target address is in the local network (for example, if the hostname contains no dots or if it's an IP address in the organization's range), return QNetworkProxy::NoProxy
  • if the request is FTP, return an FTP proxy
  • if the request is HTTP or HTTPS, then return an HTTP proxy
  • otherwise, return a SOCKSv5 proxy server

The lifetime of the object factory will be managed by QNetworkAccessManager. It will delete the object when necessary.

Note: If a specific proxy is set with setProxy(), the factory will not be used.

This function was introduced in Qt 4.5.

See also proxyFactory(), setProxy(), and QNetworkProxyQuery.

Upstream PySide2 reference signatures (binding differences may apply):

setProxyFactory(self, factory: PySide2.QtNetwork.QNetworkProxyFactory) -> None

Source: https://doc.qt.io/archives/qt-5.15/qnetworkaccessmanager.html#setProxyFactory

sslErrors

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

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

Supplemental documentation: Qt 5 reference:

[signal] void QNetworkAccessManager::sslErrors(QNetworkReply *reply, 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 and reply is the QNetworkReply that is encountering these errors.

To indicate that the errors are not fatal and that the connection should proceed, the QNetworkReply::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(), QNetworkReply::sslErrors(), QNetworkReply::sslConfiguration(), and QNetworkReply::ignoreSslErrors().

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

supportedSchemes

supportedSchemes() -> tuple

X.supportedSchemes() -> tuple

Supplemental documentation: Qt 5 reference:

QStringList QNetworkAccessManager::supportedSchemes() const

Lists all the URL schemes supported by the access manager.

This function was introduced in Qt 5.2.

See also supportedSchemesImplementation().

Upstream PySide2 reference signatures (binding differences may apply):

supportedSchemes(self) -> typing.List[str]

Source: https://doc.qt.io/archives/qt-5.15/qnetworkaccessmanager.html#supportedSchemes