Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-124766

QHttpHeaders: Add convenience methods for converting to known types

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • Network: HTTP
    • Foundation PM Prioritized

    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

        For Gerrit Dashboard: QTBUG-124766
        # Subject Branch Project Status CR V

        Activity

          People

            lenabiliaieva Olena Biliaieva
            lenabiliaieva Olena Biliaieva
            Vladimir Minenko Vladimir Minenko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change