1// Copyright (C) 2017 Witekio.
2// Copyright (C) 2018 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
4
5#ifndef QCOAPREQUEST_P_H
6#define QCOAPREQUEST_P_H
7
8#include <QtCoap/qcoapnamespace.h>
9#include <QtCoap/qcoaprequest.h>
10#include <private/qcoapmessage_p.h>
11
12//
13// W A R N I N G
14// -------------
15//
16// This file is not part of the Qt API. It exists purely as an
17// implementation detail. This header file may change from version to
18// version without notice, or even be removed.
19//
20// We mean it.
21//
22
23QT_BEGIN_NAMESPACE
24
25class Q_AUTOTEST_EXPORT QCoapRequestPrivate : public QCoapMessagePrivate
26{
27public:
28 QCoapRequestPrivate(const QUrl &url = QUrl(),
29 QCoapMessage::Type type = QCoapMessage::Type::NonConfirmable,
30 const QUrl &proxyUrl = QUrl());
31 ~QCoapRequestPrivate();
32
33 QCoapRequestPrivate *clone() const override;
34
35 void setUrl(const QUrl &url);
36 void adjustUrl(bool secure);
37
38 static QCoapRequest createRequest(const QCoapRequest &other, QtCoap::Method method,
39 bool isSecure = false);
40 static QUrl adjustedUrl(const QUrl &url, bool secure);
41 static bool isUrlValid(const QUrl &url);
42
43 QUrl uri;
44 QUrl proxyUri;
45 QtCoap::Method method = QtCoap::Method::Invalid;
46
47protected:
48 QCoapRequestPrivate(const QCoapRequestPrivate &other) = default;
49};
50
51QT_END_NAMESPACE
52
53#endif // QCOAPREQUEST_P_H
54

source code of qtcoap/src/coap/qcoaprequest_p.h