PySide6.QtHttpServer.QHttpServerWebSocketUpgradeResponse¶
- class QHttpServerWebSocketUpgradeResponse¶
Response to return when verifying WebSocket upgrades on HTTP server.
Details
Use this class to return when determining whether a socket upgrade should succeed. If
type()isAcceptupgrade the socket, iftype()isDenysend an error with the givendenyStatus()anddenyMessage(), and iftype()isPassToNextproceed to the next registered handler. If all handlers returnPassToNextor none exist,missingHandler()is executed.See also
addWebSocketUpgradeVerifier()missingHandler()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
- class ResponseType¶
Response types
Constant
Description
QHttpServerWebSocketUpgradeResponse.ResponseType.ResponseType.Accept
Accept the WebSocket upgrade request.
QHttpServerWebSocketUpgradeResponse.ResponseType.ResponseType.Deny
Deny the WebSocket upgrade request.
QHttpServerWebSocketUpgradeResponse.ResponseType.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
QHttpServerWebSocketUpgradeResponseobject fromother.- static accept()¶
- Return type:
Creates an instance of
QHttpServerWebSocketUpgradeResponsewithtype()Accept.See also
- static deny()¶
- Return type:
Creates an instance of
QHttpServerWebSocketUpgradeResponsewithtype()Deny,denyStatus()403and thedenyMessage()"Forbidden".See also
- static deny(status, message)
- Parameters:
status – int
message –
QByteArray
- Return type:
Creates an instance of
QHttpServerWebSocketUpgradeResponsewithtype()Deny,denyStatus()statusanddenyMessage()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
QHttpServerWebSocketUpgradeResponsewithtype()PassToNext.See also
- swap(other)¶
- Parameters:
Swaps the contents of this with
other- type()¶
- Return type:
Returns the type of response.
See also