Details
-
Task
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
-
8
-
Foundation Sprint 125, Foundation Sprint 126, Foundation Sprint 127
Description
When porting QtNetwork internals to QHttpHeaders, it turned out that parsing from header value to certain types (int, QDateTime, list of QNetworkCookie) was a very common operation. So it would be useful to add conversion methods for these types to the QHttpHeaders interface.
This could be done in two ways:
1) Introducing a "QHttpHeaderValue" struct/class. QHttpHeaderValue would have explicit constructors for all convenience types and conversion methods to all convenience types. Also QHttpHeaders needs setter overloads for that QHttpHeaderValue.
2) Similar to how it's done in QJsonArray: Introducing QHttpHeader(Const)Ref in keeping with CBOR/JSON classes.
After adding the new methods, temporary conversion methods could be removed from QNetworkHeadersPrivate class, and QHttpHeaders's API could be used instead.
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-124766 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
547982,12 | Add QHttpHeaders convenience methods for converting to known types | dev | qt/qtbase | Status: NEW | 0 | 0 |
627768,7 | QHttpHeaders: Add setters for QDateTime and QNetworkCookie | dev | qt/qtbase | Status: NEW | +2 | 0 |