QHttpServerWebSocketUpgradeResponse Class
The QHttpServerWebSocketUpgradeResponse class is the verdict of a verifier on a WebSocket upgrade request. More…
| Header | #include <QHttpServerWebSocketUpgradeResponse> |
|---|---|
| CMake | target_link_libraries(app PRIVATE Nt::HttpServer) |
| Module | Nt HTTP Server C++ Classes |
| Since | 6.8 |
List of all members, including inherited members
Public Types
| enum | ResponseType |
Public Functions
| QHttpServerWebSocketUpgradeResponse(const QHttpServerWebSocketUpgradeResponse &other) | |
| QHttpServerWebSocketUpgradeResponse(QHttpServerWebSocketUpgradeResponse &&other) | |
| QHttpServerWebSocketUpgradeResponse & | operator=(const QHttpServerWebSocketUpgradeResponse &other) |
| QHttpServerWebSocketUpgradeResponse & | operator=(QHttpServerWebSocketUpgradeResponse &&other) |
| ~QHttpServerWebSocketUpgradeResponse() | |
| void | swap(QHttpServerWebSocketUpgradeResponse &other) |
| ResponseType | type() const |
| int | denyStatus() const |
| QByteArray | denyMessage() const |
Static Public Members
| QHttpServerWebSocketUpgradeResponse | accept() |
| QHttpServerWebSocketUpgradeResponse | deny() |
| QHttpServerWebSocketUpgradeResponse | deny(int status, QByteArray message) |
| QHttpServerWebSocketUpgradeResponse | passToNext() |
Detailed Description
A verifier added with QAbstractHttpServer::addWebSocketUpgradeVerifier() returns accept() to turn the connection into a QWebSocket, deny() to refuse it with an HTTP error, or passToNext() to leave the decision to the next verifier.
See also QAbstractHttpServer::addWebSocketUpgradeVerifier().
Differences from Qt
None.
Member Type Documentation
enum QHttpServerWebSocketUpgradeResponse::ResponseType
The verdict.
| Constant | Description |
|---|---|
QHttpServerWebSocketUpgradeResponse::Accept | The upgrade is accepted. |
QHttpServerWebSocketUpgradeResponse::Deny | The upgrade is refused with denyStatus() and denyMessage(). |
QHttpServerWebSocketUpgradeResponse::PassToNext | The next verifier decides. |
Member Function Documentation
QHttpServerWebSocketUpgradeResponse::QHttpServerWebSocketUpgradeResponse(const QHttpServerWebSocketUpgradeResponse &other)
Constructs a copy of other.
QHttpServerWebSocketUpgradeResponse::QHttpServerWebSocketUpgradeResponse(QHttpServerWebSocketUpgradeResponse &&other)
Move-constructs a verdict from other.
QHttpServerWebSocketUpgradeResponse::~QHttpServerWebSocketUpgradeResponse()
Destroys the verdict.
QHttpServerWebSocketUpgradeResponse QHttpServerWebSocketUpgradeResponse::accept()
Returns a verdict that accepts the upgrade.
QHttpServerWebSocketUpgradeResponse QHttpServerWebSocketUpgradeResponse::deny()
Returns a verdict that refuses the upgrade with 403 Forbidden.
QHttpServerWebSocketUpgradeResponse QHttpServerWebSocketUpgradeResponse::deny(int status, QByteArray message)
This is an overloaded function.
Returns a verdict that refuses the upgrade with the HTTP status status and the body message.
QByteArray QHttpServerWebSocketUpgradeResponse::denyMessage() const
Returns the body sent when the upgrade is denied.
int QHttpServerWebSocketUpgradeResponse::denyStatus() const
Returns the HTTP status sent when the upgrade is denied.
QHttpServerWebSocketUpgradeResponse & QHttpServerWebSocketUpgradeResponse::operator=(const QHttpServerWebSocketUpgradeResponse &other)
Assigns other to this verdict and returns a reference to it.
QHttpServerWebSocketUpgradeResponse & QHttpServerWebSocketUpgradeResponse::operator=(QHttpServerWebSocketUpgradeResponse &&other)
This is an overloaded function.
Move-assigns other to this verdict and returns a reference to it.
QHttpServerWebSocketUpgradeResponse QHttpServerWebSocketUpgradeResponse::passToNext()
Returns a verdict that leaves the decision to the next verifier.
void QHttpServerWebSocketUpgradeResponse::swap(QHttpServerWebSocketUpgradeResponse &other)
Swaps this verdict with other.
ResponseType QHttpServerWebSocketUpgradeResponse::type() const
Returns the verdict.