- class QHttpServerWebSocketUpgradeResponse¶
Response to return when verifying WebSocket upgrades on HTTP server. More…
Added in version 6.8.
Synopsis¶
Methods¶
def
__init__()
def
denyMessage()
def
denyStatus()
def
swap()
def
type()
Static functions¶
def
accept()
def
deny()
def
passToNext()
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()
isAccept
upgrade the socket, iftype()
isDeny
send an error with the givendenyStatus()
anddenyMessage()
, and iftype()
isPassToNext
proceed to the next registered handler. If all handlers returnPassToNext
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:
Copy-constructs an instance of a
QHttpServerWebSocketUpgradeResponse
object fromother
.- static accept()¶
- Return type:
Creates an instance of
QHttpServerWebSocketUpgradeResponse
withtype()
Accept
.See also
- static deny()¶
- Return type:
Creates an instance of
QHttpServerWebSocketUpgradeResponse
withtype()
Deny
,denyStatus()
403 and thedenyMessage()
“Forbidden”.See also
- static deny(status, message)
- Parameters:
status – int
message –
QByteArray
- Return type:
Creates an instance of
QHttpServerWebSocketUpgradeResponse
withtype()
Deny
,denyStatus()
status
anddenyMessage()
message
.See also
- denyMessage()¶
- Return type:
Returns the error message to return if
type()
isDeny
.- denyStatus()¶
- Return type:
int
Returns the HTTP status code to return if
type()
isDeny
.- static passToNext()¶
- Return type:
Creates an instance of
QHttpServerWebSocketUpgradeResponse
withtype()
PassToNext
.See also
- swap(other)¶
- Parameters:
Swaps the contents of this with
other
- type()¶
- Return type:
Returns the type of response.
See also