QHttp1Configuration Class

The QHttp1Configuration class controls HTTP/1 parameters and settings. 更多...

头: #include <QHttp1Configuration>
CMake: find_package(Qt6 REQUIRED COMPONENTS Network)
target_link_libraries(mytarget PRIVATE Qt6::Network)
qmake: QT += network
Since: Qt 6.5

注意: 此类的所有函数 可重入 .

公共函数

QHttp1Configuration ()
QHttp1Configuration (const QHttp1Configuration & other )
QHttp1Configuration (QHttp1Configuration && other )
~QHttp1Configuration ()
qsizetype numberOfConnectionsPerHost () const
void setNumberOfConnectionsPerHost (qsizetype number )
void swap (QHttp1Configuration & other )
QHttp1Configuration & operator= (const QHttp1Configuration & other )
QHttp1Configuration & operator= (QHttp1Configuration && other )
size_t qHash (const QHttp1Configuration & key , size_t seed = 0)
bool operator!= (const QHttp1Configuration & lhs , const QHttp1Configuration & rhs )
bool operator== (const QHttp1Configuration & lhs , const QHttp1Configuration & rhs )

详细描述

QHttp1Configuration controls HTTP/1 parameters and settings that QNetworkAccessManager will use to send requests and process responses.

注意: The configuration must be set before the first request was sent to a given host (and thus an HTTP/1 session established).

另请参阅 QNetworkRequest::setHttp1Configuration (), QNetworkRequest::http1Configuration (),和 QNetworkAccessManager .

成员函数文档编制

QHttp1Configuration:: QHttp1Configuration ()

Default constructs a QHttp1Configuration object.

QHttp1Configuration:: QHttp1Configuration (const QHttp1Configuration & other )

Copy-constructs this QHttp1Configuration.

[noexcept] QHttp1Configuration:: QHttp1Configuration ( QHttp1Configuration && other )

Move-constructs this QHttp1Configuration from other .

注意: The moved-from object other is placed in a partially-formed state, in which the only valid operations are destruction and assignment of a new value.

[noexcept] QHttp1Configuration:: ~QHttp1Configuration ()

析构函数。

qsizetype QHttp1Configuration:: numberOfConnectionsPerHost () const

Returns the number of connections used per http(s) host : port combination. The default is six (6).

另请参阅 setNumberOfConnectionsPerHost .

void QHttp1Configuration:: setNumberOfConnectionsPerHost ( qsizetype number )

Sets the number of connections (minimum: 1; maximum: 255) used per http(s) host : port combination to number .

number is ≤ 0, does nothing. If number is > 255, 255 is used.

另请参阅 numberOfConnectionsPerHost .

[noexcept] void QHttp1Configuration:: swap ( QHttp1Configuration & other )

Swaps this HTTP/1 configuration with other 。此操作非常快且从不失败。

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

Copy-assigns other 到此 QHttp1Configuration .

[noexcept] QHttp1Configuration &QHttp1Configuration:: operator= ( QHttp1Configuration && other )

移动赋值 other 到此 QHttp1Configuration .

注意: The moved-from object other is placed in a partially-formed state, in which the only valid operations are destruction and assignment of a new value.

相关非成员

[noexcept, since 6.5] size_t qHash (const QHttp1Configuration & key , size_t seed = 0)

返回哈希值为 key ,使用 seed 做计算种子。

该函数在 Qt 6.5 引入。

[noexcept, since 6.5] bool operator!= (const QHttp1Configuration & lhs , const QHttp1Configuration & rhs )

返回 true if lhs and rhs do not represent the same set of HTTP/1 parameters.

该函数在 Qt 6.5 引入。

[noexcept, since 6.5] bool operator== (const QHttp1Configuration & lhs , const QHttp1Configuration & rhs )

返回 true if lhs and rhs represent the same set of HTTP/1 parameters.

该函数在 Qt 6.5 引入。