QHttpHeaders Class
QHttpHeaders 是一个用于保存 HTTP 头信息的类。更多
头信息 | #include <QHttpHeaders> |
CMake.QHttpHeaders | find_package(Qt6 REQUIRED COMPONENTS Network) target_link_libraries(mytarget PRIVATE Qt6::Network) |
qmake: | QT += network |
自 | Qt 6.7 |
公共类型
enum class | WellKnownHeader { AIM, Accept, AcceptAdditions, AcceptCH, AcceptDatetime, …, ProtocolQuery } |
公共函数
QHttpHeaders() | |
QHttpHeaders(const QHttpHeaders &other) | |
QHttpHeaders(QHttpHeaders &&other) | |
~QHttpHeaders() | |
bool | append(QAnyStringView name, QAnyStringView value) |
bool | append(QHttpHeaders::WellKnownHeader name, QAnyStringView value) |
void | clear() |
QByteArray | combinedValue(QAnyStringView name) const |
QByteArray | combinedValue(QHttpHeaders::WellKnownHeader name) const |
bool | contains(QAnyStringView name) const |
bool | contains(QHttpHeaders::WellKnownHeader name) const |
bool | insert(qsizetype i, QAnyStringView name, QAnyStringView value) |
bool | insert(qsizetype i, QHttpHeaders::WellKnownHeader name, QAnyStringView value) |
bool | isEmpty() const |
QLatin1StringView | nameAt(qsizetype i) const |
void | removeAll(QAnyStringView name) |
void | removeAll(QHttpHeaders::WellKnownHeader name) |
void | removeAt(qsizetype i) |
bool | replace(qsizetype i, QAnyStringView name, QAnyStringView newValue) |
bool | replace(qsizetype i, QHttpHeaders::WellKnownHeader name, QAnyStringView newValue) |
(since 6.8) bool | replaceOrAppend(QHttpHeaders::WellKnownHeader name, QAnyStringView newValue) |
bool | replaceOrAppend(QAnyStringView name, QAnyStringView newValue) |
void | reserve(qsizetype size) |
qsizetype | size() const |
void | swap(QHttpHeaders &other) |
QList<std::pair<QByteArray, QByteArray>> | toListOfPairs() const |
QMultiHash<QByteArray, QByteArray> | toMultiHash() const |
QMultiMap<QByteArray, QByteArray> | toMultiMap() const |
QByteArrayView | value(QAnyStringView name, QByteArrayView defaultValue = {}) const |
QByteArrayView | value(QHttpHeaders::WellKnownHeader name, QByteArrayView defaultValue = {}) const |
QByteArrayView | valueAt(qsizetype i) const |
QList<QByteArray> | values(QAnyStringView name) const |
QList<QByteArray> | values(QHttpHeaders::WellKnownHeader name) const |
QHttpHeaders & | operator=(QHttpHeaders &&other) |
QHttpHeaders & | operator=(const QHttpHeaders &other) |
静态公共成员
QHttpHeaders | fromListOfPairs(const QList<std::pair<QByteArray, QByteArray>> &headers) |
QHttpHeaders | fromMultiHash(const QMultiHash<QByteArray, QByteArray> &headers) |
QHttpHeaders | fromMultiMap(const QMultiMap<QByteArray, QByteArray> &headers) |
QByteArrayView | wellKnownHeaderName(QHttpHeaders::WellKnownHeader name) |
相关非成员
QDebug | operator<<(QDebug debug, const QHttpHeaders &headers) |
详细说明
该类是一个接口类型,用于使用或消费此类标头的 Qt Network API。
允许的字段名称和值字符
HTTP 头信息由名称和值组成。设置时,QHttpHeaders 会验证名称和值是否只包含 HTTP RFC 允许的字符。详细信息请参见RFC 9110 第 5.1 和 5.5 章。
总之,这意味着
name
必须由可见的 ASCII 字符组成,且不得为空value
value
可以为空。
该类的设置器会自动从值中移除任何前导空格或尾部空格,因为在值处理过程中必须忽略它们。
组合值
大多数 HTTP 标头值都可以用一个逗号','
加上一个可选的空格来组合,而且语义都会得到保留。例如,这两个值在语义上应该是相似的:
// Values as separate header entries myheadername: myheadervalue1 myheadername: myheadervalue2 // Combined value myheadername: myheadervalue1, myheadervalue2
不过,这条规则有一个明显的例外:Set-Cookie。因此,QHttpHeaders 不会自动合并这些值。
性能
大多数 QHttpHeaders 函数都提供QHttpHeaders::WellKnownHeader 和QAnyStringView 两种重载。从内存使用和计算的角度来看,建议使用QHttpHeaders::WellKnownHeader 重载。
成员类型文档
enum class QHttpHeaders::WellKnownHeader
根据IANA 注册表列出的知名标头。
常数 | 值 |
---|---|
QHttpHeaders::WellKnownHeader::AIM | 0 |
QHttpHeaders::WellKnownHeader::Accept | 1 |
QHttpHeaders::WellKnownHeader::AcceptAdditions | 2 |
QHttpHeaders::WellKnownHeader::AcceptCH | 3 |
QHttpHeaders::WellKnownHeader::AcceptDatetime | 4 |
QHttpHeaders::WellKnownHeader::AcceptEncoding | 5 |
QHttpHeaders::WellKnownHeader::AcceptFeatures | 6 |
QHttpHeaders::WellKnownHeader::AcceptLanguage | 7 |
QHttpHeaders::WellKnownHeader::AcceptPatch | 8 |
QHttpHeaders::WellKnownHeader::AcceptPost | 9 |
QHttpHeaders::WellKnownHeader::AcceptRanges | 10 |
QHttpHeaders::WellKnownHeader::AcceptSignature | 11 |
QHttpHeaders::WellKnownHeader::AccessControlAllowCredentials | 12 |
QHttpHeaders::WellKnownHeader::AccessControlAllowHeaders | 13 |
QHttpHeaders::WellKnownHeader::AccessControlAllowMethods | 14 |
QHttpHeaders::WellKnownHeader::AccessControlAllowOrigin | 15 |
QHttpHeaders::WellKnownHeader::AccessControlExposeHeaders | 16 |
QHttpHeaders::WellKnownHeader::AccessControlMaxAge | 17 |
QHttpHeaders::WellKnownHeader::AccessControlRequestHeaders | 18 |
QHttpHeaders::WellKnownHeader::AccessControlRequestMethod | 19 |
QHttpHeaders::WellKnownHeader::Age | 20 |
QHttpHeaders::WellKnownHeader::Allow | 21 |
QHttpHeaders::WellKnownHeader::ALPN | 22 |
QHttpHeaders::WellKnownHeader::AltSvc | 23 |
QHttpHeaders::WellKnownHeader::AltUsed | 24 |
QHttpHeaders::WellKnownHeader::Alternates | 25 |
QHttpHeaders::WellKnownHeader::ApplyToRedirectRef | 26 |
QHttpHeaders::WellKnownHeader::AuthenticationControl | 27 |
QHttpHeaders::WellKnownHeader::AuthenticationInfo | 28 |
QHttpHeaders::WellKnownHeader::Authorization | 29 |
QHttpHeaders::WellKnownHeader::CacheControl | 30 |
QHttpHeaders::WellKnownHeader::CacheStatus | 31 |
QHttpHeaders::WellKnownHeader::CalManagedID | 32 |
QHttpHeaders::WellKnownHeader::CalDAVTimezones | 33 |
QHttpHeaders::WellKnownHeader::CapsuleProtocol | 34 |
QHttpHeaders::WellKnownHeader::CDNCacheControl | 35 |
QHttpHeaders::WellKnownHeader::CDNLoop | 36 |
QHttpHeaders::WellKnownHeader::CertNotAfter | 37 |
QHttpHeaders::WellKnownHeader::CertNotBefore | 38 |
QHttpHeaders::WellKnownHeader::ClearSiteData | 39 |
QHttpHeaders::WellKnownHeader::ClientCert | 40 |
QHttpHeaders::WellKnownHeader::ClientCertChain | 41 |
QHttpHeaders::WellKnownHeader::Close | 42 |
QHttpHeaders::WellKnownHeader::Connection | 43 |
QHttpHeaders::WellKnownHeader::ContentDigest | 44 |
QHttpHeaders::WellKnownHeader::ContentDisposition | 45 |
QHttpHeaders::WellKnownHeader::ContentEncoding | 46 |
QHttpHeaders::WellKnownHeader::ContentID | 47 |
QHttpHeaders::WellKnownHeader::ContentLanguage | 48 |
QHttpHeaders::WellKnownHeader::ContentLength | 49 |
QHttpHeaders::WellKnownHeader::ContentLocation | 50 |
QHttpHeaders::WellKnownHeader::ContentRange | 51 |
QHttpHeaders::WellKnownHeader::ContentSecurityPolicy | 52 |
QHttpHeaders::WellKnownHeader::ContentSecurityPolicyReportOnly | 53 |
QHttpHeaders::WellKnownHeader::ContentType | 54 |
QHttpHeaders::WellKnownHeader::Cookie | 55 |
QHttpHeaders::WellKnownHeader::CrossOriginEmbedderPolicy | 56 |
QHttpHeaders::WellKnownHeader::CrossOriginEmbedderPolicyReportOnly | 57 |
QHttpHeaders::WellKnownHeader::CrossOriginOpenerPolicy | 58 |
QHttpHeaders::WellKnownHeader::CrossOriginOpenerPolicyReportOnly | 59 |
QHttpHeaders::WellKnownHeader::CrossOriginResourcePolicy | 60 |
QHttpHeaders::WellKnownHeader::DASL | 61 |
QHttpHeaders::WellKnownHeader::Date | 62 |
QHttpHeaders::WellKnownHeader::DAV | 63 |
QHttpHeaders::WellKnownHeader::DeltaBase | 64 |
QHttpHeaders::WellKnownHeader::Depth | 65 |
QHttpHeaders::WellKnownHeader::Destination | 66 |
QHttpHeaders::WellKnownHeader::DifferentialID | 67 |
QHttpHeaders::WellKnownHeader::DPoP | 68 |
QHttpHeaders::WellKnownHeader::DPoPNonce | 69 |
QHttpHeaders::WellKnownHeader::EarlyData | 70 |
QHttpHeaders::WellKnownHeader::ETag | 71 |
QHttpHeaders::WellKnownHeader::Expect | 72 |
QHttpHeaders::WellKnownHeader::ExpectCT | 73 |
QHttpHeaders::WellKnownHeader::Expires | 74 |
QHttpHeaders::WellKnownHeader::Forwarded | 75 |
QHttpHeaders::WellKnownHeader::From | 76 |
QHttpHeaders::WellKnownHeader::Hobareg | 77 |
QHttpHeaders::WellKnownHeader::Host | 78 |
QHttpHeaders::WellKnownHeader::If | 79 |
QHttpHeaders::WellKnownHeader::IfMatch | 80 |
QHttpHeaders::WellKnownHeader::IfModifiedSince | 81 |
QHttpHeaders::WellKnownHeader::IfNoneMatch | 82 |
QHttpHeaders::WellKnownHeader::IfRange | 83 |
QHttpHeaders::WellKnownHeader::IfScheduleTagMatch | 84 |
QHttpHeaders::WellKnownHeader::IfUnmodifiedSince | 85 |
QHttpHeaders::WellKnownHeader::IM | 86 |
QHttpHeaders::WellKnownHeader::IncludeReferredTokenBindingID | 87 |
QHttpHeaders::WellKnownHeader::KeepAlive | 88 |
QHttpHeaders::WellKnownHeader::Label | 89 |
QHttpHeaders::WellKnownHeader::LastEventID | 90 |
QHttpHeaders::WellKnownHeader::LastModified | 91 |
QHttpHeaders::WellKnownHeader::Link | 92 |
QHttpHeaders::WellKnownHeader::Location | 93 |
QHttpHeaders::WellKnownHeader::LockToken | 94 |
QHttpHeaders::WellKnownHeader::MaxForwards | 95 |
QHttpHeaders::WellKnownHeader::MementoDatetime | 96 |
QHttpHeaders::WellKnownHeader::Meter | 97 |
QHttpHeaders::WellKnownHeader::MIMEVersion | 98 |
QHttpHeaders::WellKnownHeader::Negotiate | 99 |
QHttpHeaders::WellKnownHeader::NEL | 100 |
QHttpHeaders::WellKnownHeader::ODataEntityId | 101 |
QHttpHeaders::WellKnownHeader::ODataIsolation | 102 |
QHttpHeaders::WellKnownHeader::ODataMaxVersion | 103 |
QHttpHeaders::WellKnownHeader::ODataVersion | 104 |
QHttpHeaders::WellKnownHeader::OptionalWWWAuthenticate | 105 |
QHttpHeaders::WellKnownHeader::OrderingType | 106 |
QHttpHeaders::WellKnownHeader::Origin | 107 |
QHttpHeaders::WellKnownHeader::OriginAgentCluster | 108 |
QHttpHeaders::WellKnownHeader::OSCORE | 109 |
QHttpHeaders::WellKnownHeader::OSLCCoreVersion | 110 |
QHttpHeaders::WellKnownHeader::Overwrite | 111 |
QHttpHeaders::WellKnownHeader::PingFrom | 112 |
QHttpHeaders::WellKnownHeader::PingTo | 113 |
QHttpHeaders::WellKnownHeader::Position | 114 |
QHttpHeaders::WellKnownHeader::Prefer | 115 |
QHttpHeaders::WellKnownHeader::PreferenceApplied | 116 |
QHttpHeaders::WellKnownHeader::Priority | 117 |
QHttpHeaders::WellKnownHeader::ProxyAuthenticate | 118 |
QHttpHeaders::WellKnownHeader::ProxyAuthenticationInfo | 119 |
QHttpHeaders::WellKnownHeader::ProxyAuthorization | 120 |
QHttpHeaders::WellKnownHeader::ProxyStatus | 121 |
QHttpHeaders::WellKnownHeader::PublicKeyPins | 122 |
QHttpHeaders::WellKnownHeader::PublicKeyPinsReportOnly | 123 |
QHttpHeaders::WellKnownHeader::Range | 124 |
QHttpHeaders::WellKnownHeader::RedirectRef | 125 |
QHttpHeaders::WellKnownHeader::Referer | 126 |
QHttpHeaders::WellKnownHeader::Refresh | 127 |
QHttpHeaders::WellKnownHeader::ReplayNonce | 128 |
QHttpHeaders::WellKnownHeader::ReprDigest | 129 |
QHttpHeaders::WellKnownHeader::RetryAfter | 130 |
QHttpHeaders::WellKnownHeader::ScheduleReply | 131 |
QHttpHeaders::WellKnownHeader::ScheduleTag | 132 |
QHttpHeaders::WellKnownHeader::SecPurpose | 133 |
QHttpHeaders::WellKnownHeader::SecTokenBinding | 134 |
QHttpHeaders::WellKnownHeader::SecWebSocketAccept | 135 |
QHttpHeaders::WellKnownHeader::SecWebSocketExtensions | 136 |
QHttpHeaders::WellKnownHeader::SecWebSocketKey | 137 |
QHttpHeaders::WellKnownHeader::SecWebSocketProtocol | 138 |
QHttpHeaders::WellKnownHeader::SecWebSocketVersion | 139 |
QHttpHeaders::WellKnownHeader::Server | 140 |
QHttpHeaders::WellKnownHeader::ServerTiming | 141 |
QHttpHeaders::WellKnownHeader::SetCookie | 142 |
QHttpHeaders::WellKnownHeader::Signature | 143 |
QHttpHeaders::WellKnownHeader::SignatureInput | 144 |
QHttpHeaders::WellKnownHeader::SLUG | 145 |
QHttpHeaders::WellKnownHeader::SoapAction | 146 |
QHttpHeaders::WellKnownHeader::StatusURI | 147 |
QHttpHeaders::WellKnownHeader::StrictTransportSecurity | 148 |
QHttpHeaders::WellKnownHeader::Sunset | 149 |
QHttpHeaders::WellKnownHeader::SurrogateCapability | 150 |
QHttpHeaders::WellKnownHeader::SurrogateControl | 151 |
QHttpHeaders::WellKnownHeader::TCN | 152 |
QHttpHeaders::WellKnownHeader::TE | 153 |
QHttpHeaders::WellKnownHeader::Timeout | 154 |
QHttpHeaders::WellKnownHeader::Topic | 155 |
QHttpHeaders::WellKnownHeader::Traceparent | 156 |
QHttpHeaders::WellKnownHeader::Tracestate | 157 |
QHttpHeaders::WellKnownHeader::Trailer | 158 |
QHttpHeaders::WellKnownHeader::TransferEncoding | 159 |
QHttpHeaders::WellKnownHeader::TTL | 160 |
QHttpHeaders::WellKnownHeader::Upgrade | 161 |
QHttpHeaders::WellKnownHeader::Urgency | 162 |
QHttpHeaders::WellKnownHeader::UserAgent | 163 |
QHttpHeaders::WellKnownHeader::VariantVary | 164 |
QHttpHeaders::WellKnownHeader::Vary | 165 |
QHttpHeaders::WellKnownHeader::Via | 166 |
QHttpHeaders::WellKnownHeader::WantContentDigest | 167 |
QHttpHeaders::WellKnownHeader::WantReprDigest | 168 |
QHttpHeaders::WellKnownHeader::WWWAuthenticate | 169 |
QHttpHeaders::WellKnownHeader::XContentTypeOptions | 170 |
QHttpHeaders::WellKnownHeader::XFrameOptions | 171 |
QHttpHeaders::WellKnownHeader::AcceptCharset | 172 |
QHttpHeaders::WellKnownHeader::CPEPInfo | 173 |
QHttpHeaders::WellKnownHeader::Pragma | 174 |
QHttpHeaders::WellKnownHeader::ProtocolInfo | 175 |
QHttpHeaders::WellKnownHeader::ProtocolQuery | 176 |
成员函数文档
[noexcept]
QHttpHeaders::QHttpHeaders()
创建一个新的 QHttpHeaders 对象。
QHttpHeaders::QHttpHeaders(const QHttpHeaders &other)
创建other 的副本。
[noexcept]
QHttpHeaders::QHttpHeaders(QHttpHeaders &&other)
移动-从other 开始构建对象,该对象将离开empty 。
[noexcept]
QHttpHeaders::~QHttpHeaders()
处理标头对象。
bool QHttpHeaders::append(QAnyStringView name, QAnyStringView value)
用name 和value 追加头条目,如果成功则返回true
。
另请参阅 append(QHttpHeaders::WellKnownHeader, QAnyStringView) 和Allowed field name and value characters 。
bool QHttpHeaders::append(QHttpHeaders::WellKnownHeader name, QAnyStringView value)
该函数重载了append(QAnyStringView, QAnyStringView)。
void QHttpHeaders::clear()
清除所有标头条目。
另请参阅 size().
QByteArray QHttpHeaders::combinedValue(QAnyStringView name) const
以逗号连接的字符串形式返回name 头的值。如果带有name 的标头不存在,则返回null
QByteArray 。
另请参阅 values(QAnyStringView)。
QByteArray QHttpHeaders::combinedValue(QHttpHeaders::WellKnownHeader name) const
该函数重载了combinedValue(QAnyStringView)。
bool QHttpHeaders::contains(QAnyStringView name) const
返回头信息是否包含带有name 的头信息。
另请参阅 contains(QHttpHeaders::WellKnownHeader)。
bool QHttpHeaders::contains(QHttpHeaders::WellKnownHeader name) const
该函数重载了 has(QAnyStringView)。
[static]
QHttpHeaders QHttpHeaders::fromListOfPairs(const QList<std::pair<QByteArray, QByteArray>> &headers)
创建一个新的QHttpHeaders 对象,该对象由headers 填充。
另请参阅 Allowed field name and value characters 。
[static]
QHttpHeaders QHttpHeaders::fromMultiHash(const QMultiHash<QByteArray, QByteArray> &headers)
创建一个新的QHttpHeaders 对象,该对象由headers 填充。
另请参阅 Allowed field name and value characters 。
[static]
QHttpHeaders QHttpHeaders::fromMultiMap(const QMultiMap<QByteArray, QByteArray> &headers)
创建一个新的QHttpHeaders 对象,该对象由headers 填充。
另请参阅 Allowed field name and value characters 。
bool QHttpHeaders::insert(qsizetype i, QAnyStringView name, QAnyStringView value)
在索引i 处插入一个头文件条目,其中包含name 和value 。索引必须有效(参见size() )。返回插入是否成功。
另请参阅 append(),insert(qsizetype, QHttpHeaders::WellKnownHeader, QAnyStringView),size() 和Allowed field name and value characters 。
bool QHttpHeaders::insert(qsizetype i, QHttpHeaders::WellKnownHeader name, QAnyStringView value)
该函数重载了insert(qsizetype, QAnyStringView, QAnyStringView)。
[noexcept]
bool QHttpHeaders::isEmpty() const
如果标头大小为 0,则返回true
;否则返回false
。
另请参阅 size() 。
[noexcept]
QLatin1StringView QHttpHeaders::nameAt(qsizetype i) const
返回索引i 中的标头名称。索引i 必须有效(参见size() )。
标头名称不区分大小写,返回的名称小写。
void QHttpHeaders::removeAll(QAnyStringView name)
移除头name 。
另请参阅 removeAt() 和removeAll(QHttpHeaders::WellKnownHeader)。
void QHttpHeaders::removeAll(QHttpHeaders::WellKnownHeader name)
该函数重载了removeAll(QAnyStringView)。
void QHttpHeaders::removeAt(qsizetype i)
删除索引i 上的标头。索引i 必须有效(参见size()).
另请参阅 removeAll(QHttpHeaders::WellKnownHeader)、removeAll(QAnyStringView) 和size() 。
bool QHttpHeaders::replace(qsizetype i, QAnyStringView name, QAnyStringView newValue)
用name 和newValue 替换索引i 中的页眉条目。索引必须有效(参见size() )。返回替换是否成功。
另请参阅 append(),replace(qsizetype, QHttpHeaders::WellKnownHeader, QAnyStringView),size() 和Allowed field name and value characters 。
bool QHttpHeaders::replace(qsizetype i, QHttpHeaders::WellKnownHeader name, QAnyStringView newValue)
该函数重载了replace(qsizetype, QAnyStringView, QAnyStringView)。
[since 6.8]
bool QHttpHeaders::replaceOrAppend(QHttpHeaders::WellKnownHeader name, QAnyStringView newValue)
如果QHttpHeaders 已包含name ,则将其值替换为newValue ,并删除可能的其他name 条目。如果name 不存在,则添加一个新条目。如果成功,则返回true
。
该函数是一种方便的方法,用于设置唯一的name:newValue 标头。对于大多数标头来说,相对顺序并不重要,因此如果存在现有条目,就可以重复使用。
此函数在 Qt 6.8 中引入。
另请参阅 replaceOrAppend(QAnyStringView, QAnyStringView)。
bool QHttpHeaders::replaceOrAppend(QAnyStringView name, QAnyStringView newValue)
此函数重载 replaceOrAppend(WellKnownHeader, QAnyStringView)。
void QHttpHeaders::reserve(qsizetype size)
尝试为至少size 头文件分配内存。
如果事先知道将有多少个报头条目,则可以调用此函数来防止重新分配和内存碎片。
[noexcept]
qsizetype QHttpHeaders::size() const
返回页眉条目的数量。
[noexcept]
void QHttpHeaders::swap(QHttpHeaders &other)
将QHttpHeaders 与other 互换。这一操作非常快速,而且从未出现过故障。
QList<std::pair<QByteArray, QByteArray>> QHttpHeaders::toListOfPairs() const
以(名称、值)对列表的形式返回标头条目。标头名称不区分大小写,返回的名称小写。
QMultiHash<QByteArray, QByteArray> QHttpHeaders::toMultiHash() const
返回从名称到值的哈希值。标头名称不区分大小写,返回的名称小写。
QMultiMap<QByteArray, QByteArray> QHttpHeaders::toMultiMap() const
以从名称到值的映射形式返回标头条目。标头名称不区分大小写,返回的名称小写。
[noexcept]
QByteArrayView QHttpHeaders::value(QAnyStringView name, QByteArrayView defaultValue = {}) const
返回(第一个)头name 的值,如果不存在,则返回defaultValue 。
另请参阅 value(QHttpHeaders::WellKnownHeader, QByteArrayView)。
[noexcept]
QByteArrayView QHttpHeaders::value(QHttpHeaders::WellKnownHeader name, QByteArrayView defaultValue = {}) const
该函数重载了value (QAnyStringView、QByteArrayView)。
[noexcept]
QByteArrayView QHttpHeaders::valueAt(qsizetype i) const
返回索引i 处的标头值。索引i 必须有效(参见size() )。
另请参阅 size()、value()、values()、combinedValue() 和nameAt()。
QList<QByteArray> QHttpHeaders::values(QAnyStringView name) const
以列表形式返回页眉name 的值。如果不存在name 的头信息,则返回空列表。
另请参阅 values(QHttpHeaders::WellKnownHeader)。
QList<QByteArray> QHttpHeaders::values(QHttpHeaders::WellKnownHeader name) const
该函数重载了values(QAnyStringView)。
[static noexcept]
QByteArrayView QHttpHeaders::wellKnownHeaderName(QHttpHeaders::WellKnownHeader name)
返回与作为视图提供的name 相对应的页眉名称。
[noexcept]
QHttpHeaders &QHttpHeaders::operator=(QHttpHeaders &&other)
Move-assignsother 并返回对该对象的引用。
other 将离开 。empty
QHttpHeaders &QHttpHeaders::operator=(const QHttpHeaders &other)
指定other 的内容,并返回对该对象的引用。
© 2025 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.