QCoapRequest Class

The QCoapRequest class holds a CoAP request. This request can be sent with QCoapClient . 更多...

頭: #include <QCoapRequest>
qmake: QT += coap
繼承: QCoapMessage

注意: 此類的所有函數 可重入 .

公共函數

QCoapRequest (const QCoapRequest & other )
QCoapRequest (const char * url , QCoapMessage::Type type = Type::NonConfirmable)
QCoapRequest (const QUrl & url = QUrl(), QCoapMessage::Type type = Type::NonConfirmable, const QUrl & proxyUrl = QUrl())
QCoapRequest & operator= (const QCoapRequest & other )
~QCoapRequest ()
void enableObserve ()
bool isObserve () const
QtCoap::Method method () const
QUrl proxyUrl () const
void setProxyUrl (const QUrl & proxyUrl )
void setUrl (const QUrl & url )
QUrl url () const

詳細描述

The QCoapRequest contains data needed to make CoAP frames that can be sent to the URL it holds.

另請參閱 QCoapClient , QCoapReply ,和 QCoapResourceDiscoveryReply .

成員函數文檔編製

QCoapRequest:: QCoapRequest (const QCoapRequest & other )

構造副本為 other QCoapRequest.

QCoapRequest:: QCoapRequest (const char * url , QCoapMessage::Type type = Type::NonConfirmable)

Constructs a QCoapRequest from a string literal

QCoapRequest:: QCoapRequest (const QUrl & url = QUrl(), QCoapMessage::Type type = Type::NonConfirmable, const QUrl & proxyUrl = QUrl())

Constructs a QCoapRequest object with the target url , the proxy URL proxyUrl type of the message.

QCoapRequest &QCoapRequest:: operator= (const QCoapRequest & other )

創建副本為 other .

QCoapRequest:: ~QCoapRequest ()

銷毀 QCoapRequest .

void QCoapRequest:: enableObserve ()

Sets the observe to true to make an observe request.

另請參閱 isObserve ().

bool QCoapRequest:: isObserve () const

返迴 true if the request is an observe request.

另請參閱 enableObserve ().

QtCoap::Method QCoapRequest:: method () const

Returns the method of the request.

QUrl QCoapRequest:: proxyUrl () const

Returns the proxy URI of the request. The request shall be sent directly if this is invalid.

另請參閱 setProxyUrl ().

void QCoapRequest:: setProxyUrl (const QUrl & proxyUrl )

Sets the proxy URI of the request to the given proxyUrl .

另請參閱 proxyUrl ().

void QCoapRequest:: setUrl (const QUrl & url )

Sets the target URI of the request to the given url .

If not indicated, the scheme of the URL will default to 'coap', and its port will default to 5683.

另請參閱 url ().

QUrl QCoapRequest:: url () const

Returns the target URI of the request.

另請參閱 setUrl ().