6.0.0-rc4Source

QHttpServerWebSocketUpgradeResponse Class

The QHttpServerWebSocketUpgradeResponse class is the verdict of a verifier on a WebSocket upgrade request. More…

Header#include <QHttpServerWebSocketUpgradeResponse>
CMaketarget_link_libraries(app PRIVATE Nt::HttpServer)
ModuleNt HTTP Server C++ Classes
Since6.8

List of all members, including inherited members

Public Types

Public Functions

QHttpServerWebSocketUpgradeResponse(const QHttpServerWebSocketUpgradeResponse &other)
QHttpServerWebSocketUpgradeResponse(QHttpServerWebSocketUpgradeResponse &&other)
QHttpServerWebSocketUpgradeResponse &operator=(const QHttpServerWebSocketUpgradeResponse &other)
QHttpServerWebSocketUpgradeResponse &operator=(QHttpServerWebSocketUpgradeResponse &&other)
~QHttpServerWebSocketUpgradeResponse()
voidswap(QHttpServerWebSocketUpgradeResponse &other)
ResponseTypetype() const
intdenyStatus() const
QByteArraydenyMessage() const

Static Public Members

QHttpServerWebSocketUpgradeResponseaccept()
QHttpServerWebSocketUpgradeResponsedeny()
QHttpServerWebSocketUpgradeResponsedeny(int status, QByteArray message)
QHttpServerWebSocketUpgradeResponsepassToNext()

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.

ConstantDescription
QHttpServerWebSocketUpgradeResponse::AcceptThe upgrade is accepted.
QHttpServerWebSocketUpgradeResponse::DenyThe upgrade is refused with denyStatus() and denyMessage().
QHttpServerWebSocketUpgradeResponse::PassToNextThe 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.

[static] QHttpServerWebSocketUpgradeResponse QHttpServerWebSocketUpgradeResponse::accept()

Returns a verdict that accepts the upgrade.

[static] QHttpServerWebSocketUpgradeResponse QHttpServerWebSocketUpgradeResponse::deny()

Returns a verdict that refuses the upgrade with 403 Forbidden.

[static] 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.

[static] 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.