![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include "qhttpheaders.h"#include <QtNetwork/private/qnetworkrequest_p.h>#include <private/qoffsetstringarray_p.h>#include <QtCore/qcompare.h>#include <QtCore/qhash.h>#include <QtCore/qloggingcategory.h>#include <QtCore/qmap.h>#include <QtCore/qset.h>#include <QtCore/qttypetraits.h>#include <QtCore/qxpfunctional.h>#include <q20algorithm.h>#include <string_view>#include <variant>Go to the source code of this file.
Classes | |
| struct | HeaderName |
| struct | Header |
| class | QHttpHeadersPrivate |
Variables | |
| static constexpr auto | headerNames |
| static constexpr quint8 | orderedHeaderNameIndexes [] |
| constexpr auto | NonWellKnownHeader = QHttpHeaders::WellKnownHeader{-1} |
| static constexpr auto | isValidHttpHeaderNameChar |
| static constexpr auto | isValidHttpHeaderValueChar |
|
static |
Definition at line 795 of file qhttpheaders.cpp.
|
staticnoexcept |
Definition at line 780 of file qhttpheaders.cpp.
|
static |
Definition at line 790 of file qhttpheaders.cpp.
|
staticnoexcept |
Definition at line 785 of file qhttpheaders.cpp.
| auto headerNameMatches | ( | const HeaderName & | name | ) |
Definition at line 921 of file qhttpheaders.cpp.
Referenced by QHttpHeaders::contains(), QHttpHeaders::contains(), QHttpHeadersPrivate::removeAll(), and QHttpHeadersPrivate::replaceOrAppend().
|
staticnoexcept |
Definition at line 1205 of file qhttpheaders.cpp.
References isValidHttpHeaderNameChar.
|
staticnoexcept |
Definition at line 1218 of file qhttpheaders.cpp.
|
staticnoexcept |
Definition at line 1210 of file qhttpheaders.cpp.
|
staticnoexcept |
Definition at line 1254 of file qhttpheaders.cpp.
References isValidHttpHeaderValueChar.
|
staticnoexcept |
Definition at line 1268 of file qhttpheaders.cpp.
|
staticnoexcept |
Definition at line 1259 of file qhttpheaders.cpp.
References isValidHttpHeaderValueChar.
|
staticnoexcept |
Definition at line 1225 of file qhttpheaders.cpp.
|
staticnoexcept |
Definition at line 1275 of file qhttpheaders.cpp.
|
static |
Definition at line 1283 of file qhttpheaders.cpp.
| QDataStream & operator<< | ( | QDataStream & | out, |
| const QHttpHeaders & | headers ) |
Definition at line 1162 of file qhttpheaders.cpp.
| QDebug operator<< | ( | QDebug | debug, |
| const QHttpHeaderRange & | range ) |
Definition at line 2039 of file qhttpheaders.cpp.
| QDebug operator<< | ( | QDebug | debug, |
| const QHttpHeaders & | headers ) |
Definition at line 1134 of file qhttpheaders.cpp.
| QDataStream & operator>> | ( | QDataStream & | in, |
| QHttpHeaders & | headers ) |
Definition at line 1178 of file qhttpheaders.cpp.
| Q_STATIC_LOGGING_CATEGORY | ( | lcQHttpHeaders | , |
| "qt.network.http.headers" | ) |
|
staticconstexpr |
\class QHttpHeaders
\since 6.7
\ingroup
\inmodule QtNetwork
\brief QHttpHeaders is a class for holding HTTP headers.
The class is an interface type for Qt networking APIs that
use or consume such headers.
\section1 Allowed field name and value characters
An HTTP header consists of \e name and \e value.
When setting these, QHttpHeaders validates \e name and \e value
to only contain characters allowed by the HTTP RFCs. For detailed
information see
\l {https://datatracker.ietf.org/doc/html/rfc9110#name-field-values}
{RFC 9110 Chapters 5.1 and 5.5}.
In all, this means:
\list
\li \c name must consist of visible ASCII characters, and must not be
empty
\li \c value may consist of arbitrary bytes, as long as header
and use case specific encoding rules are adhered to. \c value
may be empty
\endlist
The setters of this class automatically remove any leading or trailing
whitespaces from \e value, as they must be ignored during the
\e value processing.
\section1 Combining values
Most HTTP header values can be combined with a single comma \c {','}
plus an optional whitespace, and the semantic meaning is preserved.
As an example, these two should be semantically similar:
\badcode
Values as separate header entries myheadername: myheadervalue1 myheadername: myheadervalue2 Combined value myheadername: myheadervalue1, myheadervalue2
However, there is a notable exception to this rule: \l {https://datatracker.ietf.org/doc/html/rfc9110#name-field-order} {Set-Cookie}. Due to this and the possibility of custom use cases, QHttpHeaders does not automatically combine the values.
Definition at line 191 of file qhttpheaders.cpp.
|
staticconstexpr |
Definition at line 1187 of file qhttpheaders.cpp.
Referenced by headerNameValidImpl().
|
staticconstexpr |
Definition at line 1237 of file qhttpheaders.cpp.
Referenced by headerValueValidImpl(), and headerValueValidImpl().
|
constexpr |
Definition at line 778 of file qhttpheaders.cpp.
|
staticconstexpr |
Definition at line 407 of file qhttpheaders.cpp.