Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qnetworkrequest.cpp
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qnetworkrequest.h"
5#include "qnetworkrequest_p.h"
6#include "qplatformdefs.h"
7#include "qnetworkcookie.h"
8#include "qsslconfiguration.h"
9#if QT_CONFIG(http)
10#include "qhttp1configuration.h"
11#include "qhttp2configuration.h"
12#include "private/http2protocol_p.h"
13#endif
14
15#include "QtCore/qdatetime.h"
16#include "QtCore/qlocale.h"
17#include "QtCore/qshareddata.h"
18#include "QtCore/qtimezone.h"
19#include "QtCore/private/qtools_p.h"
20
21#include <ctype.h>
22#if QT_CONFIG(datestring)
23# include <stdio.h>
24#endif
25
26#include <algorithm>
27
29
30using namespace Qt::StringLiterals;
31
34
35
413{
414public:
415 static const int maxRedirectCount = 50;
417 : priority(QNetworkRequest::NormalPriority)
418#ifndef QT_NO_SSL
419 , sslConfiguration(nullptr)
420#endif
421 , maxRedirectsAllowed(maxRedirectCount)
422 , transferTimeout(0)
423 { qRegisterMetaType<QNetworkRequest>(); }
425 {
426#ifndef QT_NO_SSL
427 delete sslConfiguration;
428#endif
429 }
430
431
434 {
435 url = other.url;
436 priority = other.priority;
437 maxRedirectsAllowed = other.maxRedirectsAllowed;
438#ifndef QT_NO_SSL
439 sslConfiguration = nullptr;
440 if (other.sslConfiguration)
441 sslConfiguration = new QSslConfiguration(*other.sslConfiguration);
442#endif
443 peerVerifyName = other.peerVerifyName;
444#if QT_CONFIG(http)
445 h1Configuration = other.h1Configuration;
446 h2Configuration = other.h2Configuration;
447 decompressedSafetyCheckThreshold = other.decompressedSafetyCheckThreshold;
448#endif
449 transferTimeout = other.transferTimeout;
450 }
451
452 inline bool operator==(const QNetworkRequestPrivate &other) const
453 {
454 return url == other.url &&
455 priority == other.priority &&
456 rawHeaders == other.rawHeaders &&
457 attributes == other.attributes &&
458 maxRedirectsAllowed == other.maxRedirectsAllowed &&
459 peerVerifyName == other.peerVerifyName
460#if QT_CONFIG(http)
461 && h1Configuration == other.h1Configuration
462 && h2Configuration == other.h2Configuration
463 && decompressedSafetyCheckThreshold == other.decompressedSafetyCheckThreshold
464#endif
465 && transferTimeout == other.transferTimeout
466 ;
467 // don't compare cookedHeaders
468 }
469
472#ifndef QT_NO_SSL
474#endif
477#if QT_CONFIG(http)
478 QHttp1Configuration h1Configuration;
479 QHttp2Configuration h2Configuration;
480 qint64 decompressedSafetyCheckThreshold = 10ll * 1024ll * 1024ll;
481#endif
483};
484
493{
494#if QT_CONFIG(http)
495 // Initial values proposed by RFC 7540 are quite draconian, but we
496 // know about servers configured with this value as maximum possible,
497 // rejecting our SETTINGS frame and sending us a GOAWAY frame with the
498 // flow control error set. If this causes a problem - the app should
499 // set a proper configuration. We'll use our defaults, as documented.
500 d->h2Configuration.setStreamReceiveWindowSize(Http2::qtDefaultStreamReceiveWindowSize);
501 d->h2Configuration.setSessionReceiveWindowSize(Http2::maxSessionReceiveWindowSize);
502 d->h2Configuration.setServerPushEnabled(false);
503#endif // QT_CONFIG(http)
504}
505
514{
515 d->url = url;
516}
517
522 : d(other.d)
523{
524}
525
530{
531 // QSharedDataPointer auto deletes
532 d = nullptr;
533}
534
542{
543 return d == other.d || *d == *other.d;
544}
545
558{
559 d = other.d;
560 return *this;
561}
562
577{
578 return d->url;
579}
580
587{
588 d->url = url;
589}
590
599{
600 return d->cookedHeaders.value(header);
601}
602
611{
613}
614
622{
623 return d->findRawHeader(headerName) != d->rawHeaders.constEnd();
624}
625
637{
640 if (it != d->rawHeaders.constEnd())
641 return it->second;
642 return QByteArray();
643}
644
652{
653 return d->rawHeadersKeys();
654}
655
676{
678}
679
690{
691 return d->attributes.value(code, defaultValue);
692}
693
703{
704 if (value.isValid())
705 d->attributes.insert(code, value);
706 else
707 d->attributes.remove(code);
708}
709
710#ifndef QT_NO_SSL
718{
719 if (!d->sslConfiguration)
721 return *d->sslConfiguration;
722}
723
733{
734 if (!d->sslConfiguration)
736 else
738}
739#endif
740
753{
755}
756
767{
768 return d->originatingObject.data();
769}
770
779{
780 return d->priority;
781}
782
806{
807 d->priority = priority;
808}
809
819{
820 return d->maxRedirectsAllowed;
821}
822
832{
833 d->maxRedirectsAllowed = maxRedirectsAllowed;
834}
835
845{
846 return d->peerVerifyName;
847}
848
858{
859 d->peerVerifyName = peerName;
860}
861
862#if QT_CONFIG(http)
871QHttp1Configuration QNetworkRequest::http1Configuration() const
872{
873 return d->h1Configuration;
874}
882void QNetworkRequest::setHttp1Configuration(const QHttp1Configuration &configuration)
883{
884 d->h1Configuration = configuration;
885}
886
908QHttp2Configuration QNetworkRequest::http2Configuration() const
909{
910 return d->h2Configuration;
911}
912
926void QNetworkRequest::setHttp2Configuration(const QHttp2Configuration &configuration)
927{
928 d->h2Configuration = configuration;
929}
930
941qint64 QNetworkRequest::decompressedSafetyCheckThreshold() const
942{
943 return d->decompressedSafetyCheckThreshold;
944}
945
968void QNetworkRequest::setDecompressedSafetyCheckThreshold(qint64 threshold)
969{
970 d->decompressedSafetyCheckThreshold = threshold;
971}
972#endif // QT_CONFIG(http)
973
974#if QT_CONFIG(http) || defined (Q_OS_WASM)
985int QNetworkRequest::transferTimeout() const
986{
987 return d->transferTimeout;
988}
989
1004void QNetworkRequest::setTransferTimeout(int timeout)
1005{
1007}
1008#endif // QT_CONFIG(http) || defined (Q_OS_WASM)
1009
1011{
1012 switch (header) {
1014 return "Content-Type";
1015
1017 return "Content-Length";
1018
1020 return "Location";
1021
1023 return "Last-Modified";
1024
1026 return "If-Modified-Since";
1027
1029 return "ETag";
1030
1032 return "If-Match";
1033
1035 return "If-None-Match";
1036
1038 return "Cookie";
1039
1041 return "Set-Cookie";
1042
1044 return "Content-Disposition";
1045
1047 return "User-Agent";
1048
1050 return "Server";
1051
1052 // no default:
1053 // if new values are added, this will generate a compiler warning
1054 }
1055
1056 return QByteArray();
1057}
1058
1060{
1061 switch (header) {
1070 return value.toByteArray();
1071
1073 switch (value.userType()) {
1074 case QMetaType::QUrl:
1075 return value.toUrl().toEncoded();
1076
1077 default:
1078 return value.toByteArray();
1079 }
1080
1083 switch (value.userType()) {
1084 // Generate RFC 1123/822 dates:
1085 case QMetaType::QDate:
1086 return QNetworkHeadersPrivate::toHttpDate(value.toDate().startOfDay(QTimeZone::UTC));
1087 case QMetaType::QDateTime:
1088 return QNetworkHeadersPrivate::toHttpDate(value.toDateTime());
1089
1090 default:
1091 return value.toByteArray();
1092 }
1093
1095 QList<QNetworkCookie> cookies = qvariant_cast<QList<QNetworkCookie> >(value);
1096 if (cookies.isEmpty() && value.userType() == qMetaTypeId<QNetworkCookie>())
1097 cookies << qvariant_cast<QNetworkCookie>(value);
1098
1100 bool first = true;
1101 for (const QNetworkCookie &cookie : std::as_const(cookies)) {
1102 if (!first)
1103 result += "; ";
1104 first = false;
1105 result += cookie.toRawForm(QNetworkCookie::NameAndValueOnly);
1106 }
1107 return result;
1108 }
1109
1111 QList<QNetworkCookie> cookies = qvariant_cast<QList<QNetworkCookie> >(value);
1112 if (cookies.isEmpty() && value.userType() == qMetaTypeId<QNetworkCookie>())
1113 cookies << qvariant_cast<QNetworkCookie>(value);
1114
1116 bool first = true;
1117 for (const QNetworkCookie &cookie : std::as_const(cookies)) {
1118 if (!first)
1119 result += ", ";
1120 first = false;
1121 result += cookie.toRawForm(QNetworkCookie::Full);
1122 }
1123 return result;
1124 }
1125 }
1126
1127 return QByteArray();
1128}
1129
1131{
1132 if (headerName.isEmpty())
1133 return -1;
1134
1135 auto is = [&](const char *what) {
1136 return qstrnicmp(headerName.data(), headerName.size(), what) == 0;
1137 };
1138
1140 case 'c':
1141 if (is("content-type"))
1143 else if (is("content-length"))
1145 else if (is("cookie"))
1147 else if (is("content-disposition"))
1149 break;
1150
1151 case 'e':
1152 if (is("etag"))
1154 break;
1155
1156 case 'i':
1157 if (is("if-modified-since"))
1159 if (is("if-match"))
1161 if (is("if-none-match"))
1163 break;
1164
1165 case 'l':
1166 if (is("location"))
1168 else if (is("last-modified"))
1170 break;
1171
1172 case 's':
1173 if (is("set-cookie"))
1175 else if (is("server"))
1177 break;
1178
1179 case 'u':
1180 if (is("user-agent"))
1182 break;
1183 }
1184
1185 return -1; // nothing found
1186}
1187
1189{
1191 if (dt.isValid())
1192 return dt;
1193 return QVariant(); // transform an invalid QDateTime into a null QVariant
1194}
1195
1197{
1199 const QList<QByteArray> cookieList = raw.split(';');
1200 for (const QByteArray &cookie : cookieList) {
1201 QList<QNetworkCookie> parsed = QNetworkCookie::parseCookies(cookie.trimmed());
1202 if (parsed.size() != 1)
1203 return QVariant(); // invalid Cookie: header
1204
1205 result += parsed;
1206 }
1207
1209}
1210
1212{
1213 const QByteArray trimmed = raw.trimmed();
1214 if (!trimmed.startsWith('"') && !trimmed.startsWith(R"(W/")"))
1215 return QVariant();
1216
1217 if (!trimmed.endsWith('"'))
1218 return QVariant();
1219
1220 return QString::fromLatin1(trimmed);
1221}
1222
1224{
1225 const QByteArray trimmedRaw = raw.trimmed();
1226 if (trimmedRaw == "*")
1227 return QStringList(QStringLiteral("*"));
1228
1229 QStringList tags;
1230 const QList<QByteArray> split = trimmedRaw.split(',');
1231 for (const QByteArray &element : split) {
1232 const QByteArray trimmed = element.trimmed();
1233 if (!trimmed.startsWith('"'))
1234 continue;
1235
1236 if (!trimmed.endsWith('"'))
1237 continue;
1238
1239 tags += QString::fromLatin1(trimmed);
1240 }
1241 return tags;
1242}
1243
1245{
1246 const QByteArray trimmedRaw = raw.trimmed();
1247 if (trimmedRaw == "*")
1248 return QStringList(QStringLiteral("*"));
1249
1250 QStringList tags;
1251 const QList<QByteArray> split = trimmedRaw.split(',');
1252 for (const QByteArray &element : split) {
1253 const QByteArray trimmed = element.trimmed();
1254 if (!trimmed.startsWith('"') && !trimmed.startsWith(R"(W/")"))
1255 continue;
1256
1257 if (!trimmed.endsWith('"'))
1258 continue;
1259
1260 tags += QString::fromLatin1(trimmed);
1261 }
1262 return tags;
1263}
1264
1265
1267{
1268 // header is always a valid value
1269 switch (header) {
1274 // copy exactly, convert to QString
1275 return QString::fromLatin1(value);
1276
1278 bool ok;
1279 qint64 result = value.trimmed().toLongLong(&ok);
1280 if (ok)
1281 return result;
1282 return QVariant();
1283 }
1284
1287 if (result.isValid() && !result.scheme().isEmpty())
1288 return result;
1289 return QVariant();
1290 }
1291
1294 return parseHttpDate(value);
1295
1297 return parseETag(value);
1298
1300 return parseIfMatch(value);
1301
1303 return parseIfNoneMatch(value);
1304
1306 return parseCookieHeader(value);
1307
1310
1311 default:
1312 Q_ASSERT(0);
1313 }
1314 return QVariant();
1315}
1316
1319{
1322 for ( ; it != end; ++it)
1323 if (it->first.compare(key, Qt::CaseInsensitive) == 0)
1324 return it;
1325
1326 return end; // not found
1327}
1328
1330{
1331 return rawHeaders;
1332}
1333
1335{
1337 result.reserve(rawHeaders.size());
1340 for ( ; it != end; ++it)
1341 result << it->first;
1342
1343 return result;
1344}
1345
1347{
1348 if (key.isEmpty())
1349 // refuse to accept an empty raw header
1350 return;
1351
1352 setRawHeaderInternal(key, value);
1353 parseAndSetHeader(key, value);
1354}
1355
1365{
1367 rawHeaders = list;
1368
1371 for ( ; it != end; ++it)
1372 parseAndSetHeader(it->first, it->second);
1373}
1374
1376 const QVariant &value)
1377{
1379 if (name.isEmpty()) {
1380 // headerName verifies that \a header is a known value
1381 qWarning("QNetworkRequest::setHeader: invalid header value KnownHeader(%d) received", header);
1382 return;
1383 }
1384
1385 if (value.isNull()) {
1386 setRawHeaderInternal(name, QByteArray());
1388 } else {
1389 QByteArray rawValue = headerValue(header, value);
1390 if (rawValue.isEmpty()) {
1391 qWarning("QNetworkRequest::setHeader: QVariant of type %s cannot be used with header %s",
1392 value.typeName(), name.constData());
1393 return;
1394 }
1395
1396 setRawHeaderInternal(name, rawValue);
1398 }
1399}
1400
1401void QNetworkHeadersPrivate::setRawHeaderInternal(const QByteArray &key, const QByteArray &value)
1402{
1403 auto firstEqualsKey = [&key](const RawHeaderPair &header) {
1405 };
1406 rawHeaders.removeIf(firstEqualsKey);
1407
1408 if (value.isNull())
1409 return; // only wanted to erase key
1410
1411 RawHeaderPair pair;
1412 pair.first = key;
1413 pair.second = value;
1414 rawHeaders.append(pair);
1415}
1416
1417void QNetworkHeadersPrivate::parseAndSetHeader(const QByteArray &key, const QByteArray &value)
1418{
1419 // is it a known header?
1420 const int parsedKeyAsInt = parseHeaderName(key);
1421 if (parsedKeyAsInt != -1) {
1422 const QNetworkRequest::KnownHeaders parsedKey
1423 = static_cast<QNetworkRequest::KnownHeaders>(parsedKeyAsInt);
1424 if (value.isNull()) {
1425 cookedHeaders.remove(parsedKey);
1426 } else if (parsedKey == QNetworkRequest::ContentLengthHeader
1428 // Only set the cooked header "Content-Length" once.
1429 // See bug QTBUG-15311
1430 } else {
1431 cookedHeaders.insert(parsedKey, parseHeaderValue(parsedKey, value));
1432 }
1433
1434 }
1435}
1436
1437// Fast month string to int conversion. This code
1438// assumes that the Month name is correct and that
1439// the string is at least three chars long.
1440static int name_to_month(const char* month_str)
1441{
1442 switch (month_str[0]) {
1443 case 'J':
1444 switch (month_str[1]) {
1445 case 'a':
1446 return 1;
1447 case 'u':
1448 switch (month_str[2] ) {
1449 case 'n':
1450 return 6;
1451 case 'l':
1452 return 7;
1453 }
1454 }
1455 break;
1456 case 'F':
1457 return 2;
1458 case 'M':
1459 switch (month_str[2] ) {
1460 case 'r':
1461 return 3;
1462 case 'y':
1463 return 5;
1464 }
1465 break;
1466 case 'A':
1467 switch (month_str[1]) {
1468 case 'p':
1469 return 4;
1470 case 'u':
1471 return 8;
1472 }
1473 break;
1474 case 'O':
1475 return 10;
1476 case 'S':
1477 return 9;
1478 case 'N':
1479 return 11;
1480 case 'D':
1481 return 12;
1482 }
1483
1484 return 0;
1485}
1486
1488{
1489 // HTTP dates have three possible formats:
1490 // RFC 1123/822 - ddd, dd MMM yyyy hh:mm:ss "GMT"
1491 // RFC 850 - dddd, dd-MMM-yy hh:mm:ss "GMT"
1492 // ANSI C's asctime - ddd MMM d hh:mm:ss yyyy
1493 // We only handle them exactly. If they deviate, we bail out.
1494
1495 int pos = value.indexOf(',');
1496 QDateTime dt;
1497#if QT_CONFIG(datestring)
1498 if (pos == -1) {
1499 // no comma -> asctime(3) format
1500 dt = QDateTime::fromString(QString::fromLatin1(value), Qt::TextDate);
1501 } else {
1502 // Use sscanf over QLocal/QDateTimeParser for speed reasons. See the
1503 // Qt WebKit performance benchmarks to get an idea.
1504 if (pos == 3) {
1505 char month_name[4];
1506 int day, year, hour, minute, second;
1507#ifdef Q_CC_MSVC
1508 // Use secure version to avoid compiler warning
1509 if (sscanf_s(value.constData(), "%*3s, %d %3s %d %d:%d:%d 'GMT'", &day, month_name, 4, &year, &hour, &minute, &second) == 6)
1510#else
1511 // The POSIX secure mode is %ms (which allocates memory), too bleeding edge for now
1512 // In any case this is already safe as field width is specified.
1513 if (sscanf(value.constData(), "%*3s, %d %3s %d %d:%d:%d 'GMT'", &day, month_name, &year, &hour, &minute, &second) == 6)
1514#endif
1515 dt = QDateTime(QDate(year, name_to_month(month_name), day), QTime(hour, minute, second));
1516 } else {
1517 QLocale c = QLocale::c();
1518 // eat the weekday, the comma and the space following it
1519 QString sansWeekday = QString::fromLatin1(value.constData() + pos + 2);
1520 // must be RFC 850 date
1521 dt = c.toDateTime(sansWeekday, "dd-MMM-yy hh:mm:ss 'GMT'"_L1);
1522 }
1523 }
1524#endif // datestring
1525
1526 if (dt.isValid())
1528 return dt;
1529}
1530
1532{
1533 return QLocale::c().toString(dt.toUTC(), u"ddd, dd MMM yyyy hh:mm:ss 'GMT'").toLatin1();
1534}
1535
bool startsWith(QByteArrayView other) const noexcept
bool endsWith(QByteArrayView other) const noexcept
QByteArrayView trimmed() const noexcept
\inmodule QtCore
Definition qbytearray.h:57
QByteArray trimmed() const &
Definition qbytearray.h:198
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
Definition qbytearray.h:534
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
Definition qbytearray.h:474
QList< QByteArray > split(char sep) const
Splits the byte array into subarrays wherever sep occurs, and returns the list of those arrays.
char front() const
Definition qbytearray.h:132
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
Definition qbytearray.h:106
\inmodule QtCore\reentrant
Definition qdatetime.h:257
QDateTime toUTC() const
Returns a copy of this datetime converted to UTC.
bool isValid() const
Returns true if this datetime represents a definite moment, otherwise false.
void setTimeZone(const QTimeZone &toZone)
\inmodule QtCore \reentrant
Definition qdatetime.h:27
bool remove(const Key &key)
Removes the item that has the key from the hash.
Definition qhash.h:956
bool contains(const Key &key) const noexcept
Returns true if the hash contains an item with the key; otherwise returns false.
Definition qhash.h:991
T value(const Key &key) const noexcept
Definition qhash.h:1044
void clear() noexcept(std::is_nothrow_destructible< Node >::value)
Removes all items from the hash and frees up all memory used by it.
Definition qhash.h:949
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition qhash.h:1283
The QHttp1Configuration class controls HTTP/1 parameters and settings.
The QHttp2Configuration class controls HTTP/2 parameters and settings.
Definition qlist.h:74
qsizetype size() const noexcept
Definition qlist.h:386
bool isEmpty() const noexcept
Definition qlist.h:390
const_iterator constBegin() const noexcept
Definition qlist.h:615
qsizetype removeIf(Predicate pred)
Definition qlist.h:587
void append(parameter_type t)
Definition qlist.h:441
const_iterator constEnd() const noexcept
Definition qlist.h:616
const_iterator ConstIterator
Definition qlist.h:251
static QLocale c()
Returns a QLocale object initialized to the "C" locale.
Definition qlocale.h:1103
QString toString(qlonglong i) const
Returns a localized string representation of i.
Definition qlocale.cpp:1962
The QNetworkCookie class holds one network cookie.
static QList< QNetworkCookie > parseCookies(const QByteArray &cookieString)
Parses the cookie string cookieString as received from a server response in the "Set-Cookie:" header.
RawHeadersList allRawHeaders() const
void setCookedHeader(QNetworkRequest::KnownHeaders header, const QVariant &value)
QPointer< QObject > originatingObject
QList< QByteArray > rawHeadersKeys() const
void setAllRawHeaders(const RawHeadersList &list)
void setRawHeader(const QByteArray &key, const QByteArray &value)
static QByteArray toHttpDate(const QDateTime &dt)
QPair< QByteArray, QByteArray > RawHeaderPair
RawHeadersList::ConstIterator findRawHeader(const QByteArray &key) const
CookedHeadersMap cookedHeaders
static QDateTime fromHttpDate(const QByteArray &value)
QSslConfiguration * sslConfiguration
bool operator==(const QNetworkRequestPrivate &other) const
QNetworkRequest::Priority priority
QNetworkRequestPrivate(const QNetworkRequestPrivate &other)
The QNetworkRequest class holds a request to be sent with QNetworkAccessManager.
bool operator==(const QNetworkRequest &other) const
Returns true if this object is the same as other (i.e., if they have the same URL,...
void setOriginatingObject(QObject *object)
KnownHeaders
List of known header types that QNetworkRequest parses.
void setSslConfiguration(const QSslConfiguration &configuration)
Sets this network request's SSL configuration to be config.
~QNetworkRequest()
Disposes of the QNetworkRequest object.
void setHeader(KnownHeaders header, const QVariant &value)
Sets the value of the known header header to be value, overriding any previously set headers.
void setAttribute(Attribute code, const QVariant &value)
Sets the attribute associated with code code to be value value.
Priority priority() const
QVariant attribute(Attribute code, const QVariant &defaultValue=QVariant()) const
Returns the attribute associated with the code code.
QVariant header(KnownHeaders header) const
Returns the value of the known network header header if it is present in this request.
void setRawHeader(const QByteArray &headerName, const QByteArray &value)
Sets the header headerName to be of value headerValue.
QNetworkRequest()
Constructs a QNetworkRequest object with no URL to be requested.
QObject * originatingObject() const
int maximumRedirectsAllowed() const
QList< QByteArray > rawHeaderList() const
Returns a list of all raw headers that are set in this network request.
QNetworkRequest & operator=(QNetworkRequest &&other) noexcept
void setPeerVerifyName(const QString &peerName)
bool hasRawHeader(const QByteArray &headerName) const
Returns true if the raw header headerName is present in this network request.
void setMaximumRedirectsAllowed(int maximumRedirectsAllowed)
void setUrl(const QUrl &url)
Sets the URL this network request is referring to be url.
QUrl url() const
Returns the URL this network request is referring to.
void setPriority(Priority priority)
QString peerVerifyName() const
QByteArray rawHeader(const QByteArray &headerName) const
Returns the raw form of header headerName.
QSslConfiguration sslConfiguration() const
Returns this network request's SSL configuration.
\inmodule QtCore
Definition qobject.h:90
T * data() const
Definition qpointer.h:56
\inmodule QtCore
Definition qshareddata.h:19
The QSslConfiguration class holds the configuration and state of an SSL connection.
static QSslConfiguration defaultConfiguration()
Returns the default SSL configuration to be used in new SSL connections.
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
QByteArray toLatin1() const &
Definition qstring.h:559
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qstring.cpp:5710
QString first(qsizetype n) const
Definition qstring.h:337
int compare(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
Definition qstring.cpp:6498
\inmodule QtCore \reentrant
Definition qdatetime.h:189
\inmodule QtCore
Definition qurl.h:94
@ StrictMode
Definition qurl.h:98
static QUrl fromEncoded(QByteArrayView input, ParsingMode mode=TolerantMode)
Parses input and returns the corresponding QUrl.
Definition qurl.cpp:2985
\inmodule QtCore
Definition qvariant.h:64
static auto fromValue(T &&value) noexcept(std::is_nothrow_copy_constructible_v< T > &&Private::CanUseInternalSpace< T >) -> std::enable_if_t< std::conjunction_v< std::is_copy_constructible< T >, std::is_destructible< T > >, QVariant >
Definition qvariant.h:531
QSet< QString >::iterator it
const qint32 qtDefaultStreamReceiveWindowSize
const qint32 maxSessionReceiveWindowSize((quint32(1)<< 31) - 1)
Combined button and popup list for selecting options.
constexpr char toAsciiLower(char ch) noexcept
Definition qtools_p.h:87
@ TextDate
@ CaseInsensitive
int qstrnicmp(const char *str1, qsizetype len1, const char *str2, qsizetype len2)
static QString header(const QString &name)
EGLConfig config
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define qWarning
Definition qlogging.h:162
#define QT_IMPL_METATYPE_EXTERN_TAGGED(TYPE, TAG)
Definition qmetatype.h:1363
#define QT_IMPL_METATYPE_EXTERN(TYPE)
Definition qmetatype.h:1369
static int parseHeaderName(const QByteArray &headerName)
static int name_to_month(const char *month_str)
static QVariant parseETag(const QByteArray &raw)
static QVariant parseHttpDate(const QByteArray &raw)
static QVariant parseCookieHeader(const QByteArray &raw)
static QVariant parseIfNoneMatch(const QByteArray &raw)
static QByteArray headerValue(QNetworkRequest::KnownHeaders header, const QVariant &value)
static QVariant parseHeaderValue(QNetworkRequest::KnownHeaders header, const QByteArray &value)
static QByteArray headerName(QNetworkRequest::KnownHeaders header)
static int parseHeaderName(const QByteArray &headerName)
static QVariant parseIfMatch(const QByteArray &raw)
GLuint64 key
GLuint GLuint end
GLuint object
[3]
GLbitfield GLuint64 timeout
[4]
GLuint name
GLint first
const GLubyte * c
GLuint64EXT * result
[6]
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
static void split(QT_FT_Vector *b)
#define QStringLiteral(str)
long long qint64
Definition qtypes.h:55
QList< int > list
[14]
QUrl url("example.com")
[constructor-url-reference]
QObject::connect nullptr
QSharedPointer< T > other(t)
[5]