QHttpServerRequest Class
HTTPリクエストをカプセル化します。詳細...
| ヘッダー: | #include <QHttpServerRequest> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS HttpServer) target_link_libraries(mytarget PRIVATE Qt6::HttpServer) |
| qmake: | QT += httpserver |
| 以下のように: | Qt 6.4 |
パブリック型
パブリック関数
(since 6.10) | QHttpServerRequest() |
(since 6.10) | QHttpServerRequest(const QHttpServerRequest &other) |
(since 6.10) | QHttpServerRequest(QHttpServerRequest &&other) |
| ~QHttpServerRequest() | |
| QByteArray | body() const |
| QHttpHeaders | headers() && |
| const QHttpHeaders & | headers() const & |
(since 6.5) QHostAddress | localAddress() const |
(since 6.5) quint16 | localPort() const |
| QHttpServerRequest::Method | method() const |
| QUrlQuery | query() const |
| QHostAddress | remoteAddress() const |
(since 6.5) quint16 | remotePort() const |
(since 6.7) QSslConfiguration | sslConfiguration() const |
(since 6.10) void | swap(QHttpServerRequest &other) |
| QUrl | url() const |
| QByteArray | value(const QByteArray &key) const |
(since 6.10) QHttpServerRequest & | operator=(QHttpServerRequest &&other) |
(since 6.10) QHttpServerRequest & | operator=(const QHttpServerRequest &other) |
関連する非メンバ
| QDebug | operator<<(QDebug debug, const QHttpServerRequest &request) |
メンバ型のドキュメント
enum class QHttpServerRequest::Method
flags QHttpServerRequest::Methods
この列挙型は、HTTPリクエストメソッドを指定します:
| 定数 | 値 | 説明 |
|---|---|---|
QHttpServerRequest::Method::Unknown | 0x0000 | 不明なメソッド。 |
QHttpServerRequest::Method::Get | 0x0001 | HTTP GET メソッド。 |
QHttpServerRequest::Method::Put | 0x0002 | HTTP PUT メソッド。 |
QHttpServerRequest::Method::Delete | 0x0004 | HTTP DELETE メソッド。 |
QHttpServerRequest::Method::Post | 0x0008 | HTTP POST メソッド。 |
QHttpServerRequest::Method::Head | 0x0010 | HTTP HEAD メソッド。 |
QHttpServerRequest::Method::Options | 0x0020 | HTTP OPTIONS メソッド。 |
QHttpServerRequest::Method::Patch | 0x0040 | HTTP PATCH メソッド (RFC 5789)。 |
QHttpServerRequest::Method::Connect | 0x0080 | HTTP CONNECT メソッド。 |
QHttpServerRequest::Method::Trace | 0x0100 | HTTP TRACE メソッド。 |
QHttpServerRequest::Method::AnyKnown | Get | Put | Delete | Post | Head | Options | Patch | Connect | Trace | 既知のすべてのメソッドの組み合わせ。 |
Methods 型は、QFlags<Method> の typedef です。Method 値の OR 結合を格納します。
メンバ関数のドキュメント
[since 6.10] QHttpServerRequest::QHttpServerRequest()
QHttpServerRequest オブジェクトを作成します。
この関数は Qt 6.10 で導入されました。
[since 6.10] QHttpServerRequest::QHttpServerRequest(const QHttpServerRequest &other)
Copyは、other を使用して QHttpServerRequest を生成します。
この関数は Qt 6.10 で導入されました。
[constexpr noexcept default, since 6.10] QHttpServerRequest::QHttpServerRequest(QHttpServerRequest &&other)
Moveは、other を使用して QHttpServerRequest を生成します。
この関数は Qt 6.10 で導入されました。
[noexcept] QHttpServerRequest::~QHttpServerRequest()
を破壊しますQHttpServerRequest
QByteArray QHttpServerRequest::body() const
リクエストの本文を返します。
QHttpHeaders QHttpServerRequest::headers() &&
const QHttpHeaders &QHttpServerRequest::headers() const &
すべてのリクエストヘッダーを返します。
[since 6.5] QHostAddress QHttpServerRequest::localAddress() const
リクエストを受信したローカルソケットのホストアドレスを返します。
この関数は Qt 6.5 で導入されました。
[since 6.5] quint16 QHttpServerRequest::localPort() const
リクエストを受信したローカルソケットのポートを返します。
この関数は Qt 6.5 で導入されました。
QHttpServerRequest::Method QHttpServerRequest::method() const
リクエストのメソッドを返します。
QUrlQuery QHttpServerRequest::query() const
リクエストに含まれるクエリを返します。
QHostAddress QHttpServerRequest::remoteAddress() const
リクエストの発信元ホストのアドレスを返します。
[since 6.5] quint16 QHttpServerRequest::remotePort() const
リクエストの発信元ホストのポートを返します。
この関数は Qt 6.5 で導入されました。
[since 6.7] QSslConfiguration QHttpServerRequest::sslConfiguration() const
確立されたTLS接続の設定を返します。接続がTLSを使用していない場合、isNull() の評価結果は true になります。
この関数は Qt 6.7 で導入されました。
[noexcept, since 6.10] void QHttpServerRequest::swap(QHttpServerRequest &other)
このオブジェクトとother の値を交換します。
この関数は Qt 6.10 で導入されました。
QUrl QHttpServerRequest::url() const
リクエストで指定されたURLを返します。
QByteArray QHttpServerRequest::value(const QByteArray &key) const
指定されたkey を持つすべてのヘッダーの値を結合した値を返します。
[noexcept, since 6.10] QHttpServerRequest &QHttpServerRequest::operator=(QHttpServerRequest &&other)
Moveは、other を使用してQHttpServerRequest を割り当てます。
この関数は Qt 6.10 で導入されました。
[since 6.10] QHttpServerRequest &QHttpServerRequest::operator=(const QHttpServerRequest &other)
other を使用して、QHttpServerRequest を割り当てます。
この関数は Qt 6.10 で導入されました。
関連する非メンバー関数
QDebug operator<<(QDebug debug, const QHttpServerRequest &request)
request に関する情報を、debug ストリームに書き込みます。
「QDebug」も参照してください 。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.