このページでは

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

パブリック型

enum class Method { Unknown, Get, Put, Delete, Post, …, AnyKnown }
flags Methods

パブリック関数

(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)

詳細な説明

受信リクエストのさまざまなパラメータにアクセスするための API。

メンバ型のドキュメント

enum class QHttpServerRequest::Method
flags QHttpServerRequest::Methods

この列挙型は、HTTPリクエストメソッドを指定します:

定数値説明
QHttpServerRequest::Method::Unknown0x0000不明なメソッド。
QHttpServerRequest::Method::Get0x0001HTTP GET メソッド。
QHttpServerRequest::Method::Put0x0002HTTP PUT メソッド。
QHttpServerRequest::Method::Delete0x0004HTTP DELETE メソッド。
QHttpServerRequest::Method::Post0x0008HTTP POST メソッド。
QHttpServerRequest::Method::Head0x0010HTTP HEAD メソッド。
QHttpServerRequest::Method::Options0x0020HTTP OPTIONS メソッド。
QHttpServerRequest::Method::Patch0x0040HTTP PATCH メソッド (RFC 5789)。
QHttpServerRequest::Method::Connect0x0080HTTP CONNECT メソッド。
QHttpServerRequest::Method::Trace0x0100HTTP TRACE メソッド。
QHttpServerRequest::Method::AnyKnownGet | 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.