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

QHttpServer: Overload QHttpServerResponse with status codes

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.4.0 Beta3
    • None
    • Qt Http Server
    • None

    Description

      QHttpServer improvement:

      A common use case in the APIs in the modifying methods is to return created/updated value and an HTTP status code 2XX which is not 200 (e.g. Created).

      It would be much easier for the user to return a `QHttpServerResponse` both with value and status code instead of using `QHttpServerResponder` or specifying `mimeType` in the `QHttpServerResponse`

      e.g.

       

      return QHttpServerResponse(data, QHttpServerResponder::StatusCode::Created);
      

      Add Status code to those methods (defaults to `StatusCode::Ok`):

       

       

       QHttpServerResponse(const QJsonArray &data)
       QHttpServerResponse(const QJsonObject &data)
       QHttpServerResponse(QByteArray &&data)
       QHttpServerResponse(const QByteArray &data)
       QHttpServerResponse(const QString &data)
       QHttpServerResponse(const char *data)
      

       

       

      Attachments

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

        Activity

          People

            kokujawa Konrad Kujawa (Inactive)
            kokujawa Konrad Kujawa (Inactive)
            Vladimir Minenko Vladimir Minenko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes