class QHttpServerWebSocketUpgradeResponse

Response to return when verifying WebSocket upgrades on HTTP server. More

Added in version 6.8.

Synopsis

Methods

Static functions

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

Use this class to return when determining whether a socket upgrade should succeed. If type() is Accept upgrade the socket, if type() is Deny send an error with the given denyStatus() and denyMessage() , and if type() is PassToNext proceed to the next registered handler. If all handlers return PassToNext or none exist, missingHandler() is executed.

See also

addWebSocketUpgradeVerifier() missingHandler()

class ResponseType

Response types

Constant

Description

QHttpServerWebSocketUpgradeResponse.ResponseType.Accept

Accept the WebSocket upgrade request.

QHttpServerWebSocketUpgradeResponse.ResponseType.Deny

Deny the WebSocket upgrade request.

QHttpServerWebSocketUpgradeResponse.ResponseType.PassToNext

Pass the Websocket upgrade decision to the next verifier if any.

See also

addWebSocketUpgradeVerifier() type()

__init__(other)
Parameters:

otherQHttpServerWebSocketUpgradeResponse

Copy-constructs an instance of a QHttpServerWebSocketUpgradeResponse object from other.

static accept()
Return type:

QHttpServerWebSocketUpgradeResponse

Creates an instance of QHttpServerWebSocketUpgradeResponse with type() Accept .

See also

ResponseType type()

static deny()
Return type:

QHttpServerWebSocketUpgradeResponse

Creates an instance of QHttpServerWebSocketUpgradeResponse with type() Deny , denyStatus() 403 and the denyMessage() “Forbidden”.

static deny(status, message)
Parameters:
Return type:

QHttpServerWebSocketUpgradeResponse

Creates an instance of QHttpServerWebSocketUpgradeResponse with type() Deny , denyStatus() status and denyMessage() message.

denyMessage()
Return type:

QByteArray

Returns the error message to return if type() is Deny .

denyStatus()
Return type:

int

Returns the HTTP status code to return if type() is Deny .

static passToNext()
Return type:

QHttpServerWebSocketUpgradeResponse

Creates an instance of QHttpServerWebSocketUpgradeResponse with type() PassToNext .

See also

ResponseType type()

swap(other)
Parameters:

otherQHttpServerWebSocketUpgradeResponse

Swaps the contents of this with other

type()
Return type:

ResponseType

Returns the type of response.

See also

ResponseType